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

fix(python): Assert SQLInterfaceError is raised #16713

Merged
merged 2 commits into from
Jun 4, 2024

Conversation

wence-
Copy link
Collaborator

@wence- wence- commented Jun 4, 2024

No description provided.

@wence-
Copy link
Collaborator Author

wence- commented Jun 4, 2024

cc @alexander-beedie

@github-actions github-actions bot added fix Bug fix python Related to Python Polars labels Jun 4, 2024
Copy link
Collaborator

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @wence- !

@MarcoGorelli
Copy link
Collaborator

aah looks like there's another issue in that file

_________________________ test_frame_sql_globals_error _________________________
[gw0] linux -- Python 3.8.18 /home/runner/work/polars/polars/py-polars/.venv/bin/python3
tests/unit/sql/test_miscellaneous.py:99: in test_frame_sql_globals_error
    df1.sql(query=query)
polars/dataframe/frame.py:4734: in sql
    return ctx.execute(query)  # type: ignore[return-value]
polars/sql/context.py:281: in execute
    res = wrap_ldf(self._ctxt.execute(query))
E   polars.exceptions.SQLInterfaceError: relation 'df2' was not found

@wence- wence- changed the title fix(python): Correct missing ComputeError import fix(python): assert SQLInterfaceError is raised Jun 4, 2024
@alexander-beedie
Copy link
Collaborator

alexander-beedie commented Jun 4, 2024

I believe you just need to rebase; there are now dedicated SQLInterface & SQLSyntax errors.

@wence-
Copy link
Collaborator Author

wence- commented Jun 4, 2024

aah looks like there's another issue in that file

Thanks, I didn't actually run this, which was a mistake

@wence-
Copy link
Collaborator Author

wence- commented Jun 4, 2024

I believe you just need to rebase; there are now dedicated SQLInterface & SQLSyntax errors.

We need to actually catch SQLInterfaceError in this case though, right? (As @MarcoGorelli just pushed) Rather than ComputeError as is in main.

@MarcoGorelli
Copy link
Collaborator

There's a hypothesis test that has failed, but that's unrelated to what you're fixing

FAILED tests/unit/operations/namespaces/temporal/test_datetime.py::test_series_datetime_timeunits - polars.exceptions.ComputeError: datetime '1959-10-25 01:00:00' is ambiguous in time zone 'America/Nassau'. Please use `ambiguous` to tell how it should be localized.
while generating 's' from series(dtype=Datetime, min_size=1, max_size=10, allow_null=False)
You can reproduce this example by temporarily adding @reproduce_failure('6.103.0', b'AAABAKkAAQApCRcUAAAAAAAA') as a decorator on your test case

I think this can be merged to get CI green again, I'll make a separate PR to address the hypothesis failure

@alexander-beedie
Copy link
Collaborator

alexander-beedie commented Jun 4, 2024

Ahhh, I see what happened; merging the backlog of breaking changes left this test a little out of order. It's already fixed in #16711, for example, which is from a branch that was pending merge of the breaking changes and accounts for them. Can merge either to get this test green again.

@MarcoGorelli
Copy link
Collaborator

if ##16711 already fixes it, let's go with that?

closing this one then, but thanks @wence- for your PR!

@MarcoGorelli
Copy link
Collaborator

@wence- are you still able to restore this branch? it may take a little longer to get #16711 in, if you could restore it and reopen I think we could just merge and get ci green again

@wence- wence- restored the wence/fix/missing-import branch June 4, 2024 11:15
@wence-
Copy link
Collaborator Author

wence- commented Jun 4, 2024

@wence- are you still able to restore this branch? it may take a little longer to get #16711 in, if you could restore it and reopen I think we could just merge and get ci green again

Done (restored), I don't have permissions to reopen this PR though.

@MarcoGorelli
Copy link
Collaborator

thanks!

@MarcoGorelli MarcoGorelli reopened this Jun 4, 2024
Copy link

codecov bot commented Jun 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.47%. Comparing base (9912af0) to head (d57da14).
Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16713      +/-   ##
==========================================
- Coverage   81.49%   81.47%   -0.02%     
==========================================
  Files        1416     1415       -1     
  Lines      186880   186768     -112     
  Branches     3023     3022       -1     
==========================================
- Hits       152289   152167     -122     
- Misses      34059    34069      +10     
  Partials      532      532              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MarcoGorelli MarcoGorelli merged commit d3db31d into pola-rs:main Jun 4, 2024
25 of 26 checks passed
@MarcoGorelli
Copy link
Collaborator

thanks @wence- !

@wence- wence- deleted the wence/fix/missing-import branch June 4, 2024 12:09
@stinodego stinodego changed the title fix(python): assert SQLInterfaceError is raised fix(python): Assert SQLInterfaceError is raised Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants