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

Breaking change in the release between 3.0.10 and 3.1.0 #506

Closed
cgramberg-indeed opened this issue Jan 30, 2024 · 6 comments · Fixed by #508
Closed

Breaking change in the release between 3.0.10 and 3.1.0 #506

cgramberg-indeed opened this issue Jan 30, 2024 · 6 comments · Fixed by #508

Comments

@cgramberg-indeed
Copy link

Hello, I have found that there is a breaking change here in a recent release where the Cursor class (and I think all the built in cursors) no longer set default values for any of these arguments : s3_staging_dir, schema_name, catalog_name, work_group, poll_interval, encryption_option, kms_key, kill_on_interrupt, result_reuse_enable, result_reuse_minutes.

I'm thinking that at least the base Cursor class needs these default values. Here is an example of code that would function in 3.0.10 but breaks in 3.1.0:

cursor = Cursor(
    connection=Connection(),
    converter=DefaultTypeConverter(),
    formatter=DefaultParameterFormatter(),
    retry_config=RetryConfig(),
)

This will cause a TypeError: __init__() missing 10 required positional arguments: 's3_staging_dir', 'schema_name', 'catalog_name', 'work_group', 'poll_interval', 'encryption_option', 'kms_key', 'kill_on_interrupt', 'result_reuse_enable', and 'result_reuse_minutes'

Normally it is not an issue because the Connection handles initializing the Cursor but we have a subclass of Cursor which we were initializing directly in our unit tests.

@laughingman7743
Copy link
Owner

This error is affected by the following changes:
#504
Do you have any good ideas to fix this error?

@laughingman7743
Copy link
Owner

#507

@woosuk-choi-g
Copy link
Contributor

This error is affected by the following changes: #504 Do you have any good ideas to fix this error?

In my opinion, I believe this issue arose due to this commit.

The default value has been removed from some constructor parameters of the class Cursor.

@laughingman7743
Copy link
Owner

Ah, you are right, it is not the most recent type hint change.

@laughingman7743
Copy link
Owner

I need to fix it so that each cursor sets a default value. I will fix it soon.

@cgramberg-indeed
Copy link
Author

cgramberg-indeed commented Jan 31, 2024

I need to fix it so that each cursor sets a default value. I will fix it soon.

I agree that this is the ideal fix! Thank you for the fast reply!

@laughingman7743 laughingman7743 linked a pull request Feb 3, 2024 that will close this issue
laughingman7743 added a commit that referenced this issue Feb 3, 2024
Revert missing cursor default arguments. (fix #506)
laughingman7743 added a commit that referenced this issue Feb 3, 2024
Revert missing cursor default arguments. (fix #506)
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 a pull request may close this issue.

3 participants