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

Change metadata_id to UUID in solrDist #198

Merged
merged 6 commits into from
Aug 22, 2023
Merged

Change metadata_id to UUID in solrDist #198

merged 6 commits into from
Aug 22, 2023

Conversation

johtoblan
Copy link
Collaborator

@johtoblan johtoblan commented Aug 22, 2023

Summary:

  • Fixes an error in SolrDistribute, where it will get multiple metadata_UUID, due to positional and keyword arguments
  • Fixes enforcing of namespace on the construct-identifier-function for the worker-class.
  • Rewrote tests for SolrDistribute.delete functionality

Related issue:

Suggested reviewer(s):

Reviewer checklist:

  • The headers of all files contain a reference to the repository license
  • 100% test coverage of new code - meaning:
    • The overall test coverage increased or remained the same as before
    • Every function is accompanied with a test suite
    • Tests are both positive (testing that the function work as intended with valid data) and negative (testing that the function behaves as expected with invalid data, e.g., that correct exceptions are thrown)
    • Functions with optional arguments have separate tests for all options
  • Examples are supported by doctests
  • All tests are passing
  • All names (e.g., files, classes, functions, variables) are explicit
  • Documentation (as docstrings) is complete and understandable

The checklist is based on the S-ENDA conventions and definition of done (see General Conventions). The above points are not necessarily relevant to all contributions. In that case, please add a short explanation to help the reviewer.

@johtoblan
Copy link
Collaborator Author

johtoblan commented Aug 22, 2023

Relevant error:


 [2023-08-22 11:43:35,807]                 dmci.api.app:1414 ERROR    Exception on /v1/insert [POST]                             
Traceback (most recent call last):                                                                                              
File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 2190, in wsgi_app                                         
  response = self.full_dispatch_request()                                                                                   
File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1486, in full_dispatch_request                           
    rv = self.handle_user_exception(e)                                                                                         
File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1484, in full_dispatch_request                      
   rv = self.dispatch_request()                                                                                              
File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1469, in dispatch_request                              
     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)                                                    
File "/usr/local/lib/python3.10/dist-packages/dmci/api/app.py", line 69, in post_insert                                      
  msg, code = self._insert_update_method_post("insert", request)                                                           
File "/usr/local/lib/python3.10/dist-packages/dmci/api/app.py", line 157, in _insert_update_method_post                     
  err = self._distributor_wrapper(worker)                                                                                   
File "/usr/local/lib/python3.10/dist-packages/dmci/api/app.py", line 198, in _distributor_wrapper                          
  status, valid, _, failed, skipped, failed_msg = worker.distribute()                                                      
File "/usr/local/lib/python3.10/dist-packages/dmci/api/worker.py", line 189, in distribute                               
  obj = self.CALL_MAP[dist](                                                                                               
File "/usr/local/lib/python3.10/dist-packages/dmci/distributors/solr_dist.py", line 44, in __init__                 
  super().__init__(cmd, xml_file, metadata_id, worker, **kwargs)                                                       
TypeError: Distributor.__init__() got multiple values for argument 'metadata_UUID'                                    
         

tests/test_dist/test_solr_dist.py Outdated Show resolved Hide resolved
@johtoblan johtoblan requested a review from mortenwh August 22, 2023 13:58
@johtoblan johtoblan merged commit 50c18d5 into main Aug 22, 2023
@johtoblan johtoblan deleted the update_id_solr_dist branch August 22, 2023 17:44
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