-
Notifications
You must be signed in to change notification settings - Fork 1
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
Support collections editing and new DS type #43
Conversation
TODO setting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, it's good PR. But fix style, please.
@@ -18,16 +18,16 @@ | |||
|
|||
|
|||
class DataSourceType(int, Enum): | |||
"Data source types" | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why docstring remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because it doesn’t bring any valuable information here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. So there are two ways to go about it: write valuable docstring or turn off the linter rule missing-class-docstring.
Or |
The different case originates from the BFF API, which being in JavaScript contradicts Python style. How could we map fields nicely onto each other so that one doesn’t have to copy them manually? Maybe to implement constructor for the typed dict? |
BFF API already mapped (manually) to Python-style DTOs in client code. Why copy manually?
|
Nope. Otherwise as said I would be able to do |
@knopki how do I better implement |
I recommend correcting the stylistic errors in this PR ( |
@knopki
client.v0.collections.create()
also supports editing the existing collections (theid
has to be supplied), see https://github.com/basf/metis-bff/blob/f6f73257d6f2603496118676969663e4d6e4deaa/routes/%5Bversion%5D/collections/_helpers.js#L65However here is a caveat: 3 kwargs
typeId
,dataSources
, andusers
are mapped ontotype_id
,data_source_ids
, anduser_ids
(note camel case vs. snake case) which prevents me from doingclient.v0.collections.create(**dict(metis_collection_changed))
. I assume, theMetisCollectionCreateDTO
should be upgraded for that, right?