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

form number xpath and notices without namespaces #81

Merged
merged 1 commit into from
Apr 26, 2022
Merged

Conversation

Dragos0000
Copy link
Collaborator

No description provided.

@codecov
Copy link

codecov bot commented Apr 25, 2022

Codecov Report

Merging #81 (7e05ada) into main (2eaf80d) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main      #81   +/-   ##
=======================================
  Coverage   99.06%   99.06%           
=======================================
  Files          59       59           
  Lines        2362     2362           
=======================================
  Hits         2340     2340           
  Misses         22       22           
Impacted Files Coverage Δ
...r/services/xml_manifestation_metadata_extractor.py 98.71% <100.00%> (ø)
...sws/metadata_normaliser/services/xpath_registry.py 98.90% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bd22467...7e05ada. Read the comment docs.

Copy link
Collaborator

@costezki costezki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neat!

@@ -117,7 +117,7 @@ def xpath_legal_basis_directive_third(self):

@property
def xpath_form_number(self):
return "manifestation_ns:FORM_SECTION/*[1]"
return ".//*[@FORM]"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is way way better and more robust

@@ -263,7 +263,7 @@ def _get_normalised_namespaces(self):
namespaces = dict([node for _, node in ET.iterparse(source=StringIO(self.xml_manifestation.object_data),
events=['start-ns'])])

namespaces["manifestation_ns"] = namespaces.pop("")
namespaces["manifestation_ns"] = namespaces.pop("") if "" in namespaces.keys() else ""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we remove the default NS? If that is for Semantic engineers, then we no longer need it. the XPath works with default namespace now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a notice that didn't have namespace from the test data in the F03 package. So it is a safety net in case it will come without namespace

@Dragos0000 Dragos0000 merged commit fa9b745 into main Apr 26, 2022
@Dragos0000 Dragos0000 deleted the feature/TED-296 branch April 26, 2022 11:22
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