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

community: undo azure_ad_access_token breaking change #25818

Merged

Conversation

efriis
Copy link
Member

@efriis efriis commented Aug 28, 2024

No description provided.

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Aug 28, 2024
Copy link

vercel bot commented Aug 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Aug 30, 2024 2:04am

@efriis efriis enabled auto-merge (squash) August 28, 2024 17:50
@dosubot dosubot bot added community Related to langchain-community Ɑ: vector store Related to vector store module labels Aug 28, 2024
@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Aug 29, 2024
@OhNotWilliam
Copy link

OhNotWilliam commented Aug 29, 2024

This fix is very important Pipeline broke, while nothing changed. Please merge this.

For people googling this problem:
Fixes the error "ERROR! Failed because of: AzureSearch.init() missing 1 required positional argument: 'azure_ad_access_token'" in case you are not providing the token as none.

@levalencia
Copy link
Contributor

levalencia commented Aug 29, 2024

I can create another PR for this, but the issue is

def __init__(
    self,
    azure_search_endpoint: str,
    azure_search_key: str,
    azure_ad_access_token: Optional[str]    ,
    index_name: str,
    embedding_function: Union[Callable, Embeddings],
    search_type: str = "hybrid",
    semantic_configuration_name: Optional[str] = None,
    fields: Optional[List[SearchField]] = None,
    vector_search: Optional[VectorSearch] = None,
    semantic_configurations: Optional[
        Union[SemanticConfiguration, List[SemanticConfiguration]]

so defaulting it to None, means the order of parameters must change as parameters with default values must be after required paramers, and if the key is required, then the access token is not, and viceversa.

@efriis @baskaryan what do you suggest here?

@baskaryan
Copy link
Collaborator

I can create another PR for this, but the issue is

def __init__(
    self,
    azure_search_endpoint: str,
    azure_search_key: str,
    azure_ad_access_token: Optional[str]    ,
    index_name: str,
    embedding_function: Union[Callable, Embeddings],
    search_type: str = "hybrid",
    semantic_configuration_name: Optional[str] = None,
    fields: Optional[List[SearchField]] = None,
    vector_search: Optional[VectorSearch] = None,
    semantic_configurations: Optional[
        Union[SemanticConfiguration, List[SemanticConfiguration]]

so defaulting it to None, means the order of parameters must change as parameters with default values must be after required paramers, and if the key is required, then the access token is not, and viceversa.

@efriis @baskaryan what do you suggest here?

not sure i follow, you're saying only one of azure_search_key and azure_ad_access_token is required? in that case we can update azure_search_key to be Optional[str]. But yea we can't give it a default value bc we'd need to move it then and that's a breaking change

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Aug 30, 2024
@efriis efriis merged commit f7e6275 into master Aug 30, 2024
27 checks passed
@efriis efriis deleted the erick/community-undo-azure-ad-access-token-breaking-change branch August 30, 2024 02:06
@levalencia
Copy link
Contributor

Well you authenticate with api key or with access token not with both, so that means both need to be optional with default to None?

@levalencia
Copy link
Contributor

I checked master, it was fixed by adding None and changing the order, the PR was not reverted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Related to langchain-community lgtm PR looks good. Use to confirm that a PR is ready for merging. size:M This PR changes 30-99 lines, ignoring generated files. Ɑ: vector store Related to vector store module
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants