Open pdweerdt opened 1 month ago
This is indeed expected, pkey_sondering
is a custom calculated field in pydov, and is not queryable. This is also listed in the fields (query: false
):
from pydov.search.interpretaties import FormeleStratigrafieSearch
itp = FormeleStratigrafieSearch()
print(itp.get_fields()['pkey_sondering'])
{'name': 'pkey_sondering', 'type': 'string', 'definition': 'URL die verwijst naar de gegevens van de sondering waaraan deze interpretatie gekoppeld is (indien gekoppeld aan een sondering).', 'notnull': False, 'query': False, 'cost': 1}
However you could use the field Proeffiche
on which the pkey_sondering
field is based. In your use case this will yield the same results:
from pydov.util.query import PropertyInList
from pydov.search.interpretaties import FormeleStratigrafieSearch
itp = FormeleStratigrafieSearch()
so_keys = ['https://www.dov.vlaanderen.be/data/sondering/1992-000977',
'https://www.dov.vlaanderen.be/data/sondering/2009-000089']
query = PropertyInList(propertyname='Proeffiche', lst=so_keys)
df = itp.search(
query=query
)
print(df)
Description
I want to search for interpretations (formele stratigrafie) based on a list of sonderingen (pkey_sondering) After running the code, I got an InvalidFieldError: Cannot use return field 'pkey_sondering' in query."
What I Did