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

164 checking for inconsistencies in parsers and writers methods #170

Conversation

mla2001
Copy link
Contributor

@mla2001 mla2001 commented Jan 10, 2025

Updated XML reader and writers with the new signature.

reader:
def read(infile: Union[str, Path], validate: bool = False, use_dataset_id: bool = False)
writer:
def write(datasets: Sequence[PandasDataset], output_path: str = "", prettyprint: bool = True, header: Optional[Header] = Header(), dimension_at_observation: Optional[Dict[str, str]] = None)

@mla2001 mla2001 linked an issue Jan 10, 2025 that may be closed by this pull request
@mla2001 mla2001 requested a review from javihern98 January 10, 2025 12:41
src/pysdmx/io/xml/sdmx21/writer/structure.py Dismissed Show dismissed Hide dismissed
@mla2001 mla2001 marked this pull request as ready for review January 10, 2025 14:14
Signed-off-by: javier.hernandez <javier.hernandez@meaningfuldata.eu>


def write(
datasets: Sequence[STR_TYPES],
Copy link
Contributor

Choose a reason for hiding this comment

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

Change to structures, these are not datasets when we write metadata

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed

with open(output_path, "w", encoding="UTF-8", errors="replace") as f:
f.write(outfile)

return None
Copy link
Contributor

Choose a reason for hiding this comment

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

This is redundant, please remove it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It raises a mypy error if the return None is missing

…writing and removing redundancies

Signed-off-by: javier.hernandez <javier.hernandez@meaningfuldata.eu>
@javihern98
Copy link
Contributor

Closing as it is included in #172

@javihern98 javihern98 closed this Jan 13, 2025
@javihern98 javihern98 deleted the 164-checking-for-inconsistencies-in-parsers-and-writers-methods branch January 17, 2025 16:05
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.

Checking for inconsistencies in parsers and writers methods
2 participants