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

Issue223 #260

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

paul-bradbeer
Copy link

@paul-bradbeer paul-bradbeer commented Nov 12, 2023

Description

Previously, the usmart api script (usmart.py) outputs to a .csv which is then ingested into merge_data.py. This should be converted to a .json output to keep consistent with the rest of the project.

Changes done in a way which allows a mix and match approach while other providers are switched from csv to json

Motivation and Context

See original ticket

How Has This Been Tested?

Unit tests (pytest) written for JSON objects and testing reading/writing of the same

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • [xI have added tests to cover my changes.
  • All new and existing tests passed.

@paul-bradbeer paul-bradbeer marked this pull request as ready for review November 12, 2023 16:25
@paul-bradbeer paul-bradbeer mentioned this pull request Nov 12, 2023
4 tasks
@JackGilmore JackGilmore linked an issue Nov 25, 2023 that may be closed by this pull request
4 tasks
Copy link
Member

@JackGilmore JackGilmore left a comment

Choose a reason for hiding this comment

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

Got a couple of errors I encountered but looks good and an interesting approach to JSON encoding I wasn't aware of personally.

Apologies for the delay in getting to review this. If you're out of spare time now then please just let me know and I can look into investigating the errors if you're okay with that.

],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.defaultInterpreterPath": "F:\\Program Files\\python3.9\\python"
Copy link
Member

Choose a reason for hiding this comment

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

Would remove this as it's dependent on the machine config of whoever's running the scripts


processor.write_json(fname, prepped)

processor = ProcessorUSMART()

Copy link
Member

Choose a reason for hiding this comment

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

processor.process() below needs updated to pass the file_type param value of json I think. When I ran this I was still getting .csv file names instead of .json files

@@ -110,7 +110,7 @@ def main():
source_usmart = pd.concat(
[
source_usmart,
pd.read_csv(
pd.read_json(
folder + r"/" + filename,
parse_dates=["DateCreated", "DateUpdated"],
Copy link
Member

Choose a reason for hiding this comment

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

This line caused an error for me. I think it needs to be convert_dates instead

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.

Replace .csv in usmart api
2 participants