We're loving the new Table row operations APIs (query_table_rows, batch_upsert_table_rows etc). Nice work!
We note that getting the right string formatting for the FILTER and FINDROW formulas can be a bit finicky. To make the APIs more accessible to a wider range of Python devs, in addition to the examples provided, developers using the Python API may find it helpful to see some examples using f-strings in the queries. For example, using the Stocks table from your documentation, to find the AMZN stock row:
Great feedback too on what you're experiencing with the formulas; we can see how it can be tricky at times when it comes to writing and updating queries.
I'll highlight though that the approach you provided works well, as that is also how we'd recommend to write the query.
I'm going to pass on your request to our team to add more examples to our API documentation. If you think of anything else in particular that would be helpful to see, let us know.
Hi I really appreciate this example, however even following it bit by bit, I am getting a "InvalidParameterValueException" , how can I debug that? I just put my Table name and column name and it gives me the error. Many thanks in advance!
Thanks for the answer, I am putting already the WB and Table ID into the parameters.
Should I use them in the Filter Formula as well, like this, where "8146e4f-6748-4111-b80f-7d3f2dba604a" is my Table ID?
Keep in mind that the table name and column name need to be within the same table as the Table ID, and the value you're looking to find must be in that table as well. Looking at your formula, there may be a syntax error as well (remove the * after the %).
Many thanks Alyssa, I did some test with the FILTER formula in honeyCode and then found the solution for my code.
My purpose was to create a CSV file on S3 for each month of my records, to limit the time of execution of my Python script on AWS Lambda.
To do so, I created a calculated column with the MONTH function in HoneyCode and then performed the filter with this formula in Python:
currmonth = time.strftime("%m")
filterFormula = {"formula": f'=FILTER(A_SPESE_MAIN,"A_SPESE_MAIN[Mese]=%", "{currmonth}")'}
"Mese" is Month in italian.
Now I will be able to archive my personal expenses in a monthly basis and analyze them efficiently through Athena
Thanks again