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

Refactor cursor retrieval in PostgresHook. #35498

Merged
merged 4 commits into from
Nov 7, 2023

Conversation

ylnsnv
Copy link
Contributor

@ylnsnv ylnsnv commented Nov 7, 2023

Refactored the _get_cursor method for improved efficiency and error handling.
The method now uses a dictionary for cursor type lookup, streamlining the addition of future cursor types and providing clearer error messages for invalid cursors.

… for efficient cursor type resolution and clearer error messaging.
@potiuk potiuk changed the title Optimized cursor retrieval in PostgresHook. Refactor cursor retrieval in PostgresHook. Nov 7, 2023
@potiuk
Copy link
Member

potiuk commented Nov 7, 2023

NIT: (changed the name) It's refactotr, not optimisatio. It's llikely (not sure) lest optimized than previous code but indeed nicer.

@potiuk
Copy link
Member

potiuk commented Nov 7, 2023

NIT: (changed the name) It's refactor, not optimisation :). It's llikely (not sure) lest optimized than previous code but indeed nicer.

@ylnsnv ylnsnv requested a review from potiuk November 7, 2023 14:19
@ylnsnv
Copy link
Contributor Author

ylnsnv commented Nov 7, 2023

I've just, hopefully, fixed the failing tests from the last time you approved by running the pre-commit (my bad for not running it earlier), @potiuk thanks for reviewing! :)

@potiuk potiuk merged commit a777bf8 into apache:main Nov 7, 2023
Copy link

boring-cyborg bot commented Nov 7, 2023

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

romsharon98 pushed a commit to romsharon98/airflow that referenced this pull request Nov 10, 2023
* Improve cursor lookup in PostgresHook, Refactored  to use a dictionary for efficient cursor type resolution and clearer error messaging.

* Ran pre-commit that removed redundant spaces that doesn't match the format of code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants