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

Drive by fixes #1 #208

Merged
merged 11 commits into from
Sep 22, 2023
Merged

Drive by fixes #1 #208

merged 11 commits into from
Sep 22, 2023

Conversation

andlaus
Copy link
Collaborator

@andlaus andlaus commented Sep 21, 2023

This PR consists of fixes for issues I've noticed while preparing #203. It turned out to be quite a bit larger than the motivating PR...

(note: all patches of this PR are fully self-contained and the PR is also bisectable. Since all commits should be basically independent of each other, it is probably easier to review the PR by looking at the patches individually instead of the cumulative diff.)

Andreas Lauser <andreas.lauser@mercedes-benz.com>, on behalf of MBition GmbH.
Provider Information

Since all fields are data object properties, they are coded using
`ValueParameter` and a lot of complexity can be avoided in not handling
them separately in the en-/decoding logic...

Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io>
Signed-off-by: Gerrit Ecke <gerrit.ecke@mbition.io>
…eter to be `None`

in this case, the result returned will most likely be incorrect...

Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io>
Signed-off-by: Gerrit Ecke <gerrit.ecke@mbition.io>
that's because according to the ODX specification, requests and
responses are *not* structures! (TODO: reflect this in the python code.)

Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io>
Signed-off-by: Gerrit Ecke <gerrit.ecke@mbition.io>
… MatchingRequestParameter

this enables better type checking and is the right way to do this in
general...

Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io>
Signed-off-by: Gerrit Ecke <gerrit.ecke@mbition.io>
…d for a service

Although technically allowed, a service without a request is like
computer without RAM...

Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io>
Signed-off-by: Gerrit Ecke <gerrit.ecke@mbition.io>
this allows mypy to check that the attributes and properties called
actually exist instead of complaining.

Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io>
Signed-off-by: Gerrit Ecke <gerrit.ecke@mbition.io>
previously this lead to quite a few complaints...

Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io>
Signed-off-by: Gerrit Ecke <gerrit.ecke@mbition.io>
curtsey of `ruff`...

Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io>
Signed-off-by: Gerrit Ecke <gerrit.ecke@mbition.io>
@andlaus andlaus requested a review from kayoub5 September 21, 2023 08:23
@andlaus andlaus force-pushed the drive_by_fixes_1 branch 3 times, most recently from fa99534 to b5734cb Compare September 21, 2023 08:43
version.py is auto-generated and we can do little if the modules which
we rely on do not provide type annotations...

Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io>
Signed-off-by: Gerrit Ecke <gerrit.ecke@mbition.io>
@andlaus andlaus force-pushed the drive_by_fixes_1 branch 4 times, most recently from 057d572 to f2bbdc5 Compare September 21, 2023 09:28
the arguments have become superfluous because we specify the them via
`pyproject.toml` now...

Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io>
Signed-off-by: Gerrit Ecke <gerrit.ecke@mbition.io>
odxtools/basicstructure.py Outdated Show resolved Hide resolved
as usual, the merrits go to [at]kayoub5.

Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io>
Signed-off-by: Gerrit Ecke <gerrit.ecke@mbition.io>
@andlaus andlaus merged commit fcda5ae into mercedes-benz:main Sep 22, 2023
6 checks passed
@andlaus andlaus deleted the drive_by_fixes_1 branch December 7, 2023 13:29
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.

2 participants