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

Apply correct schema for all upgrades #271

Merged
merged 7 commits into from Mar 17, 2022
Merged

Apply correct schema for all upgrades #271

merged 7 commits into from Mar 17, 2022

Conversation

rajeee
Copy link
Contributor

@rajeee rajeee commented Mar 8, 2022

Pull Request Description

When different upgrades have different set of columns with some some columns having all empty values, the datatype for the columns will not be properly set. This PR fixes the issue by scanning all the results_jobX.json files in the beginning and determines the datatype for all columns.

Checklist

Not all may apply

  • Code changes (must work)
  • Tests exercising your feature/bug fix (check coverage report on Checks -> BuildStockBatch Tests -> Artifacts)
  • Coverage has increased or at least not decreased. Update minimum_coverage in .github/workflows/ci.yml as necessary.
  • All other unit tests passing
  • Update validation for project config yaml file changes
  • Update existing documentation
  • Run a small batch run to make sure it all works (local is fine, unless an Eagle specific feature)
  • Add to the changelog_dev.rst file and propose migration text in the pull request

@github-actions
Copy link

github-actions bot commented Mar 8, 2022

File Coverage
All files 79%
base.py 84%
eagle.py 71%
exc.py 57%
localdocker.py 27%
postprocessing.py 84%
utils.py 96%
sampler/base.py 69%
sampler/downselect.py 33%
sampler/precomputed.py 93%
sampler/residential_quota.py 50%
test/test_validation.py 97%
workflow_generator/base.py 90%
workflow_generator/commercial.py 24%
workflow_generator/residential.py 96%
workflow_generator/residential_hpxml.py 61%

Minimum allowed coverage is 24%

Generated by 🐒 cobertura-action against 6659280

@rajeee rajeee requested a review from nmerket March 8, 2022 23:46
Copy link
Member

@nmerket nmerket left a comment

Choose a reason for hiding this comment

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

Looks good. One minor suggestion.

logger.info(f"Got {len(all_schema_dict)} columns")
all_results_cols = list(all_schema_dict.keys())
all_schema_dict = {to_camelcase(key): value for key, value in all_schema_dict.items()}
logger.info(f"Got this schema: {all_schema_dict}\n")
Copy link
Member

Choose a reason for hiding this comment

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

Seems unnecessary to print this out. Maybe helpful for debugging, but now that it's working you're probably good to remove this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I debated keeping it or removing it. But I kept it because over information (upto a limit!) is better than under information for debugging, and postprocessing.out is kinda used mostly for debugging, so may it's fine to leave? Most users probably don't need to read the postprocessing.out unless they can't find their table in Athena.

logger.info(f"Got {len(all_schema_dict)} columns")
all_results_cols = list(all_schema_dict.keys())
all_schema_dict = {to_camelcase(key): value for key, value in all_schema_dict.items()}
logger.info(f"Got this schema: {all_schema_dict}\n")
Copy link
Member

Choose a reason for hiding this comment

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

Seems unnecessary to print this out. Maybe helpful for debugging, but now that it's working you're probably good to remove this.

Suggested change
logger.info(f"Got this schema: {all_schema_dict}\n")

@nmerket nmerket merged commit 608279d into develop Mar 17, 2022
@nmerket nmerket deleted the postprocessing_fix branch March 17, 2022 21:56
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.

None yet

2 participants