Hi all,
I have a Notebook hosted in our AGOL org that will sometimes fail with error code 400 "Cannot perform query. Invalid query parameters. Unable to perform query. Please check your parameters.". But successfully executes at other times. The 'where' parameter is built at runtime to setup a datetime query and full statement looks like,
layer.delete_features(where="{} < '{}'".format(row.attributes['dateColumnName'],(datetime.utcnow() - timedelta(days=row.attributes['daysToKeep'])).strftime("%Y-%m-%d %H:%M:%S")),future=True)
The actual query at runtime would read as (or the datetime from 479 days ago compared to utcnow(),
location_timestamp < '2021-07-31 18:55:18'
When running this same exact where against the REST query api it works as expected. Again, this will successfully run the delete_features() method at times so I'm unsure how to trace the issue if it is an intermittent problem as this Notebook runs on AGOL hosted environment.