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

update to normaliser #66

Merged
merged 3 commits into from
Apr 19, 2022
Merged

update to normaliser #66

merged 3 commits into from
Apr 19, 2022

Conversation

Dragos0000
Copy link
Collaborator

No description provided.

@codecov
Copy link

codecov bot commented Apr 19, 2022

Codecov Report

Merging #66 (18c2e83) into main (2bb5c0e) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #66      +/-   ##
==========================================
+ Coverage   98.89%   98.92%   +0.02%     
==========================================
  Files          53       53              
  Lines        1901     1951      +50     
==========================================
+ Hits         1880     1930      +50     
  Misses         21       21              
Impacted Files Coverage Δ
ted_sws/core/model/metadata.py 100.00% <100.00%> (ø)
...etadata_normaliser/services/metadata_normalizer.py 100.00% <100.00%> (ø)
ted_sws/resources/mapping_files_registry.py 100.00% <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 2bb5c0e...18c2e83. Read the comment docs.

filtered_df = filter_df_by_variables(df=mapping_df, form_number=filter_variables["form_number"],
sf_notice_type=filter_variables["sf_notice_type"],
legal_basis=filter_variables["legal_basis"],
document_code=filter_variables["document_code"])
form_type = filtered_df["form_type"].values[0]
Copy link
Collaborator

Choose a reason for hiding this comment

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

use constants instead raw strings

extracted_notice_type=extracted_notice_type,
legal_basis=legal_basis,
document_type_code=document_type_code)
filtered_df = filter_df_by_variables(df=mapping_df, form_number=filter_variables["form_number"],
Copy link
Collaborator

Choose a reason for hiding this comment

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

”form_number” use constants instead raw strings

value=self.normalise_legal_basis_value(
extracted_metadata.legal_basis_directive
)),
"form_number": self.normalise_form_number(value=extracted_metadata.extracted_form_number),
Copy link
Collaborator

Choose a reason for hiding this comment

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

use constants instead raw strings

document_type_code="7",
legal_basis="legal")
assert isinstance(filter_variables_dict,dict)
assert filter_variables_dict["form_number"] == "F03"
Copy link
Collaborator

Choose a reason for hiding this comment

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

use constants instead raw strings

Copy link
Collaborator

@CaptainOfHacks CaptainOfHacks left a comment

Choose a reason for hiding this comment

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

Well done!

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.

well done!

do not hard-coded so HARD the values which can be constants.

there is a typo (possibly) in the CSV

F05,,,,17
F06,,,,30
F07,,,O,15
Copy link
Collaborator

Choose a reason for hiding this comment

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

did we forget a 0 there ?

@@ -37,3 +37,6 @@ def sf_notice_df(self):
def ef_notice_df(self):
return get_mapping_csv_file("eforms_mapping.csv")

@property
def filter_map_df(self):
return get_mapping_csv_file("df_filter_map.csv")
Copy link
Collaborator

Choose a reason for hiding this comment

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

the filename shall be a constant (light-coded), not a hardcoded value

Copy link
Collaborator

Choose a reason for hiding this comment

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

idem for other mappings

@Dragos0000 Dragos0000 merged commit f273aec into main Apr 19, 2022
@Dragos0000 Dragos0000 deleted the feature/TED-196 branch April 19, 2022 17:35
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.

3 participants