-
Notifications
You must be signed in to change notification settings - Fork 14
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
#38 add metadata #61
#38 add metadata #61
Conversation
@funkydunc Can you rebase against main now that #63 is merged? That should hopefully fix the failing tests. |
I don't know why the linter is failing only for one Python version 😕 Given that the tests pass for the others, I don't see this as a block to merge, but it would be nice to work out why! |
What happens if the function is passed a dict or langstring instance, per Glen's comment? |
@azaroth42 @glenrobson how would you like the function to accept args as different datatypes? Would something like this, using additional keyword arguments on the method be ok?
|
I'd lean more on others (cc @azaroth42 @digitaldogsbody @giacomomarchioro) on if this is the python way of doing things but could you check the type to see if its String, dict or LngString? |
+1 to testing the type of the argument. if type(label) == dict: # do dict stuff |
@azaroth42 @glenrobson is there an exception type you would want me to import and raise if the supplied arguments are invalid? Thanks. |
I would say raise |
If the param is invalid, then upstream validation in pydantic should catch it? I would be fine with handling valid cases and ignoring invalid ones. |
@azaroth42 The add_metadata function now also accepts It validates that the label and value params are either Incorrect types, or params of unequal types returns ValueError. Validation also has a test. |
We need to re-run the tests to see why it failed. Mike to change workflow on: target - forces workflow to run from main rather than remote target. |
#38
AddMetadata class with tests