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

feat: adding python cac and experimentation client wrapper #182

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

namitgoel
Copy link
Contributor

Problem

Describe the problem you are trying to solve here

Solution

Provide a brief summary of your solution so that reviewers can understand your code

Environment variable changes

What ENVs need to be added or changed

Pre-deployment activity

Things needed to be done before deploying this change (if any)

Post-deployment activity

Things needed to be done after deploying this change (if any)

API changes

Endpoint Method Request body Response Body
API GET/POST, etc request response

Possible Issues in the future

Describe any possible issues that could occur because of this change

def _polling_update_worker(self):
self.rust_lib.cac_start_polling_update(self.tenant.encode())

def get_cac_config(self, filter_query: str, filter_prefix: str) -> str:
Copy link
Collaborator

Choose a reason for hiding this comment

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

@namitgoel filter_query, filter_prefix is optional argument , can you make the corresponding changes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

def get_last_modified(self) -> str:
return self.rust_lib.cac_get_last_modified(self.get_cac_client()).decode()

def get_resolved_config(self, query: str, filter_keys: str, merge_strategy: str) -> str:
Copy link
Collaborator

@pratikmishra356 pratikmishra356 Aug 7, 2024

Choose a reason for hiding this comment

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

here also filter_keys is optional

Copy link
Contributor Author

Choose a reason for hiding this comment

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

return self.rust_lib.cac_get_resolved_config(
self.get_cac_client(), query.encode(), filter_keys.encode(), merge_strategy.encode()).decode()

def get_default_config(self, filter_keys: str) -> str:
Copy link
Collaborator

Choose a reason for hiding this comment

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

here also it is optional

Copy link
Contributor Author

Choose a reason for hiding this comment

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

def _polling_update_worker(self):
self.rust_lib.cac_start_polling_update(self.tenant.encode())

def get_cac_config(self, filter_query: str = "{}", filter_prefix: str = "") -> str:
Copy link
Collaborator

Choose a reason for hiding this comment

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

@namitgoel can we add filter_prefix: str = None, default as None instead of empty string in all arguments

Copy link
Contributor Author

Choose a reason for hiding this comment

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

self.get_experimentation_client(), context.encode(), toss
).decode()

def get_satisfied_experiments(self, context: str, filter_prefix: str) -> str:
Copy link
Collaborator

Choose a reason for hiding this comment

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

here filter_prefix is also optional

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

@Datron Datron left a comment

Choose a reason for hiding this comment

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

@namitgoel can we include function documentation in client-context-aware-configuration.md too? Not a blocker

@Datron Datron merged commit 46b7342 into juspay:main Aug 9, 2024
4 checks passed
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.

3 participants