-
Notifications
You must be signed in to change notification settings - Fork 478
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
SNOW-592647 consolidate definitions and resolve circular dependency issues #1158
Conversation
7a3a790
to
bf61e05
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change itself looks good to me. I'm wondering if there is a test or linter to make sure we don't accidentally introduce circular dependencies in the future?
Python itself will do this for you, just importing |
dadd484
to
1c3fb18
Compare
Thanks to #1158 (comment) I found that in the case of |
Please answer these questions before submitting your pull requests. Thanks!
What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-592647: IndexError: list index out of range in snowflake/connector/result_batch.py:698: IndexError #1145
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
In this PR I fix an issue that was introduced in SNOW-499804 Add Geography Types #966 where a new type was added to
snowflake.connector.constants.FIELD_TYPES
, but this type was not added toFIELD_TYPE_TO_PA_TYPE
defined insnowflake.connector.result_batch.ArrowResultBatch._create_empty_table
.In this PR I move the later definition into the former to prevent them drifting apart in the future.
I had to then move around definitions and import statements to prevent circular import issues and I also rewrote a couple of tests.