Skip to content

Conversation

@sjyangkevin
Copy link
Contributor

@sjyangkevin sjyangkevin commented May 11, 2025

Hi all,

I want to raise this PR to resolve the issue #38350
Closes: #38350
The main changes include

  • Refactor the @cached_property decorated get_conn(self) to a regular method.
  • Add a private attribute self._client to store the client instance. If the attribute is already initialized to a client instance, this instance will be reused.
  • The other methods that reference the get_conn attribute are also refactored to use get_conn() method.

All the test cases related to the Cohere providers are checked and updated correspondingly. Unit tests are run successfully.

Thank you for your time to review in advance, and I would appreciate any feedback, and let me know if there is any potential change needed for the PR.


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

Copy link
Member

@jason810496 jason810496 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR.

@eladkal eladkal merged commit 30f5c68 into apache:main May 12, 2025
64 checks passed
@boring-cyborg
Copy link

boring-cyborg bot commented May 12, 2025

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

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.

Change CohereHook.get_conn type from property to method in the next major apache-airflow-providers-cohere

3 participants