Skip to content

Conversation

@nevoodoo
Copy link
Collaborator

@nevoodoo nevoodoo commented Apr 2, 2025

The outputs dict in the analysis object used a basename key to identify the file path. This is confusing as the resulting outputs file object contains both path AND basename properties. basename normally only contains the file name and extension, so use of this to denote a file path was a poor choice from myself :/

See the thread here: https://centrepopgen.slack.com/archives/C030X7WGFCL/p1743555245218149

The outputs dict in the analysis object used a "basename" key to identify
the file path. This is confusing as the resulting outputs file object
contains both "path" AND "basename" properties. basename normally
only contains the file name and extension, so use of this to denote
a file path was a poor choice from myself :/
@codecov
Copy link

codecov bot commented Apr 2, 2025

Codecov Report

Attention: Patch coverage is 30.00000% with 7 lines in your changes missing coverage. Please review.

Project coverage is 82.35%. Comparing base (e2960d8) to head (c85bbd7).

Files with missing lines Patch % Lines
db/python/tables/output_file.py 30.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1038      +/-   ##
==========================================
- Coverage   82.56%   82.35%   -0.21%     
==========================================
  Files         189      189              
  Lines       16459    16459              
==========================================
- Hits        13589    13555      -34     
- Misses       2870     2904      +34     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nevoodoo nevoodoo requested review from Copilot and dancoates April 2, 2025 01:46
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

The purpose of this PR is to update the outputs dictionary to use the key "path" instead of "basename" for clarity.

  • Updated test cases in test_analysis_output_files.py to use the "path" key.
  • Modified production code in output_file.py to consistently refer to file paths using "path".
  • Adjusted inline comments to reflect the changes.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
test/test_analysis_output_files.py Updated test assertions to check for "path" instead of "basename".
db/python/tables/output_file.py Modified functions and comments to use "path" consistently in file outputs.

nevoodoo and others added 2 commits April 2, 2025 12:47
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
@nevoodoo nevoodoo force-pushed the fcf-switch-path-key branch from e849020 to 17654fc Compare April 2, 2025 02:12
Copy link
Collaborator

@dancoates dancoates left a comment

Choose a reason for hiding this comment

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

This looks like a reasonable change, as long as the stuff testing the tests is pulled out into a separate PR once you're done testing it.

The main thing that needs consideration is the backwards incompatibility of this change. I found one place that basename is being used in our code: https://github.com/populationgenomics/cpg-methods-private/blob/1954e369d9248a9557cf44084a5956d0e2986603/scripts/bioheart/update_DRAGEN_analyses.py#L73 might be good for you to have a look through too to see if I missed any

@nevoodoo nevoodoo force-pushed the fcf-switch-path-key branch from c85bbd7 to 17654fc Compare April 2, 2025 03:30
@dancoates
Copy link
Collaborator

Also noting there's a wip implementation here:
https://github.com/populationgenomics/production-pipelines/pull/1261/files
that would need to consider this change.

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