Merged
Conversation
-> Before we were using the json which introduced some potential confusion now it uses the directory object -> Move functions inside class -> Move default setting inside here... the API returning default in that way still not best but working in existing pattern
-> move default dir and label setting to optional and more cleanly define at init instead of inside auth -> use new directory class -> use new get_directory_list() -> get dir now checks if none -> Added print statements for now since still so much changing but those can be optional log statements in future of course
only schema is needed not directory id (changing API side too)
only needed in some cases, heavy requirement to put here
init_file_ids asumes the id was already set but for now refresh_from_dict pattern means the id is set after init so refactor `init_files()` and call it after... We will need to work on this more Luckily at least now it's refactored to `convert_json_to_sdk_object()` so we have it only in one place
PJEstrada
reviewed
Jun 17, 2022
sdk/diffgram/file/view.py
Outdated
| response = requests.get(self.host + endpoint, | ||
| params = params, | ||
| headers = {'directory_id': str(self.directory_id)}, | ||
| headers = {'schema_id': str(schema_id)}, |
Contributor
There was a problem hiding this comment.
Thanks Anthony!
I'm wondering if we can remove the headers param too? It seems that we are already sending it in the query params. As seen here I feel there's nowhere we use the schema_id in the header: https://github.com/diffgram/diffgram/blob/29067ea49f4a8bd770ce8cd0b2220a0e5cd9420b/default/methods/annotation/labels/view.py#L36
And 2nd reason for moving away from custom headers is that we need to add custom ingresses rules to the nginx ingress in the k8s context like this:
Member
Author
There was a problem hiding this comment.
Hey Pablo That makes sense! Agree 100%
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes
Refactors