Skip to content

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

Description

@Taragolis

Body

CohereHook change use property

@cached_property
def get_conn(self) -> cohere.Client:

Instead of method

def get_conn(self) -> Any:
"""Return connection for the hook."""
raise NotImplementedError()

Should be changed into the next major version.

For save caching it might be changed to something like (just for a reference)

class CohereHook(BaseHook):
    ...
    def get_conn(self) -> client.Cohere: 
    """Some useful docstring""" 
        return self.client
    
    @cached_property
    def get_conn(self) -> client.Cohere: 
    """Some useful docstring""" 
        ... # Some implementation for obtain client here

Committer

  • I acknowledge that I am a maintainer/committer of the Apache Airflow project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions