Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle exceptions when comparing dataframes with single value #96

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

rishsriv
Copy link
Member

Previously, the question What's the average duration between departure and arrival times minus 34 minutes? Convert from UNIX to regular datetime., we always got a 'bool' object has no attribute 'all' error

Using the traceback, it seems like the error was coming from this section of the code:

Traceback (most recent call last):
  File "/Users/rishabh/defog/sql-eval/eval/api_runner.py", line 54, in process_row
    exact_match, correct = compare_query_results(
  File "/Users/rishabh/defog/sql-eval/eval/eval.py", line 348, in compare_query_results
    if compare_df(
  File "/Users/rishabh/defog/sql-eval/eval/eval.py", line 250, in compare_df
    if df_gold.shape == df_gen.shape and (df_gold.values == df_gen.values).all():
AttributeError: 'bool' object has no attribute 'all'

This fixes this with better exception handling

@rishsriv rishsriv requested a review from wendy-aw March 19, 2024 07:32
@rishsriv rishsriv merged commit 405542f into main Mar 19, 2024
2 checks passed
@rishsriv rishsriv deleted the rishabh/fix-eval branch March 19, 2024 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants