Skip to content

Suggesting a fix to the platformclient so a region can be specified t…#40

Open
rweeber-coveo wants to merge 1 commit intomainfrom
platform_base_url_fix
Open

Suggesting a fix to the platformclient so a region can be specified t…#40
rweeber-coveo wants to merge 1 commit intomainfrom
platform_base_url_fix

Conversation

@rweeber-coveo
Copy link

This pull request is to review a simple fix to the platformclient.py and source.py classes that allow for a region parameter to be passed into the constructor. There is a default constructor value for region so that existing adoption of the SDK will continue to function. This is not a breaking change.

@rweeber-coveo rweeber-coveo requested review from a team, alexprudhomme, fpbrault and olamothe and removed request for a team October 29, 2024 21:55
@rweeber-coveo
Copy link
Author

The build failed due to something I think related to this bug: pypa/setuptools#4483. It's not something I can address on my end.

@louis-bompart
Copy link
Collaborator

Hi @rweeber-coveo , if you can look at why the CI is failing and fix that in another PR, that'd be much appreciated.
I won't be able to merge those changes until then.

Comment on lines -190 to +191
return f'https://api.cloud.coveo.com/push/v1/organizations/{self.organizationid}'
return f'https://api-{self.region}.cloud.coveo.com/push/v1/organizations/{self.organizationid}'

Choose a reason for hiding this comment

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

I don't think https://api-us.cloud.coveo.com/push/v1/organizations/ is equal to https://api.cloud.coveo.com/push/v1/organizations/.

I can't find mentions of -us
https://docs.coveo.com/en/2976/manage-an-organization/deployment-regions-and-strategies

@evgenyfadeev
Copy link

Perhaps this method might be better:

source = Source('my_key', 'my_org', 
                             platform_push_api_domain='my_push_domain', 
                             platform_rest_api_domain='my_rest_domain')

Here is a PR: #42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants