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
refactor: replace resource instance factory (DEV-2876) #594
refactor: replace resource instance factory (DEV-2876) #594
Conversation
This PR is by no means perfect; especially one should add more tests, which now should already be considerably easier. But I would like to keep the PR size manageable, so I would prefer not tho have to do this in this one. |
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 a very cool PR, congrats, and thanks for tidying up this mess!
There are a lot of minor comments.
The only major concern are the errors raised in resource_create_client.py
. As far as I see, they would be triggered during the upload. But in xmlupload.py
, line 354, only BaseErrors are catched. So during a very long upload, it could happen that the program crashes because of bad input data. This could easily be prevented if we make sure that the only error that is raised in resource_create_client.py
is BaseError. (Or, if xmlupload.py
catches Exception
.)
Another observation: There seem to be several Yet another |
I can't see any code path where this would be an issue - from what I can tell, there is really only one instance around (apart from the one on line 156, which as you mention, isn't relevant, because it is just there to ensure initialization of the variable in an error case. |
|
If you have a look at this bit of code: dsp-tools/src/dsp_tools/utils/xmlupload/xmlupload.py Lines 279 to 349 in 922703b
Does this make sense? But I will try to implement an IRI resolver to hide this ugly behaviour behind a nice facade :) |
No description provided.