seed icon indicating copy to clipboard operation
seed copied to clipboard

Unable to filter inventory by derived columns

Open ebeers-png opened this issue 2 years ago • 4 comments

Describe the bug

I'm unable to filter the inventory by a derived column on the new/beta inventory list. It seems to work fine on the old inventory list.

Actual Behavior

After typing in a filter, the spinner wheel appears, and I see an error for this POST request (where "Source EUI Recalculated" is the name of the derived column):

https://seeddemostaging.lbl.gov/api/v3/properties/filter/?Source EUI Recalculated__icontains=1&cycle=404&include_related=true&organization_id=303&page=1&per_page=100

Steps to Reproduce

  1. Add a derived column to a column profile.
  2. Type anything into that column's filter box.

Instance Information

I found this error on one of ClearlyEnergy's instances of BEAM, which I'm currently updating to v2.15.1, but I confirmed that the bug was also in SEED on seeddemostaging.lbl.gov.

Additional Context

My error log from running BEAM locally (where the name of the column is "Derived column"):

File ".../seed/views/v3/properties.py", line 532, in filter
  return get_filtered_results(request, 'property', profile_id=profile_id)
File ".../seed/utils/inventory_filter.py", line 110, in get_filtered_results
  views_list = views_list.annotate(**annotations).filter(filters).order_by(*order_by)
...
File ".../.pyenv/versions/seed/lib/python3.9/site-packages/django/db/models/sql/query.py", line 1339, in build_filter
    raise FieldError('Related Field got invalid lookup: {}'.format(lookups[0]))
django.core.exceptions.FieldError: Related Field got invalid lookup: Derived column

ebeers-png avatar Jul 26 '22 18:07 ebeers-png

This issue has been automatically marked as stale because it has not had recent activity within 60 days. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Sep 25 '22 02:09 github-actions[bot]

This issue has been closed automatically. If this still affects you please re-open this issue with a comment or contact us so we can look into resolving it.

github-actions[bot] avatar Oct 02 '22 02:10 github-actions[bot]

This is still needed.

anchapin avatar Oct 03 '22 12:10 anchapin

Issue #3438 should fix this issue as well. Therefore, refer to the progress of that issue.

anchapin avatar Oct 06 '22 13:10 anchapin

I'm going to close this ticket since it is effectively a duplicate of #3438.

anchapin avatar Mar 23 '23 19:03 anchapin