Skip to content

Conversation

@joverlee521
Copy link
Contributor

@joverlee521 joverlee521 commented Nov 4, 2025

Description of proposed changes

Resolves #1925

Checklist

  • Automated checks pass
  • Check if you need to add a changelog message
  • Check if you need to add tests
  • Check if you need to update docs

@codecov
Copy link

codecov bot commented Nov 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.17%. Comparing base (e452789) to head (b89691f).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1926      +/-   ##
==========================================
+ Coverage   74.15%   74.17%   +0.01%     
==========================================
  Files          82       82              
  Lines        8986     8984       -2     
  Branches     1828     1827       -1     
==========================================
  Hits         6664     6664              
+ Misses       2018     2017       -1     
+ Partials      304      303       -1     

☔ 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.

Tests were failing because the order of the guessed type outputs
were not guaranteed, causing the test to fail.¹

Since these outputs are not relevant to the functionality being tested,
just redirect to /dev/null.

¹ <https://github.com/nextstrain/augur/actions/runs/19080508592/job/54507536513#step:9:20>
Copy link
Member

@jameshadfield jameshadfield left a comment

Choose a reason for hiding this comment

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

Read through the changes and tests

Validating produced JSON
Validating that the JSON is internally consistent...

> --output dataset.json &> /dev/null
Copy link
Member

Choose a reason for hiding this comment

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

Tests were failing because the order of the guessed type outputs were not guaranteed, causing the test to fail.¹

This stood out to me -- where does the stochasticity come from? (I've seen related issues where STDOUT/STDERR ordering was platform dependent, but this comment implies the ordering of (e.g.) field_A and field_B differs stochastically.)

This isn't blocking, but it seems weird...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I was just tracking this down. This is due to node_data_names, which is a set created in parse_node_data_metadata.

We can guarantee order here if we sort the node_data_names:

diff --git a/augur/export_v2.py b/augur/export_v2.py
index 06cbf038fd..3fe320c455 100644
--- a/augur/export_v2.py
+++ b/augur/export_v2.py
@@ -1213,7 +1213,7 @@
             config=get_config_colorings_as_dict(config),
             command_line_colorings=args.color_by_metadata,
             metadata_names=metadata_names,
-            node_data_colorings=node_data_names,
+            node_data_colorings=sorted(node_data_names),
             provided_colors=read_colors(args.colors),
             node_attrs=node_attrs,
             branch_attrs=branch_attrs

Copy link
Member

Choose a reason for hiding this comment

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

Ah interesting. That implies set ordering is different across different python versions / interpreters. (I realise order's not guaranteed, but still interesting to see it in practice.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, set order could be different per invocation, you can also see this with:

$ python -c "print(set('abcde'))"
{'a', 'b', 'e', 'c', 'd'}
$ python -c "print(set('abcde'))"
{'b', 'e', 'd', 'a', 'c'}

@joverlee521 joverlee521 merged commit a30b7f6 into master Nov 4, 2025
43 checks passed
@joverlee521 joverlee521 deleted the export-url branch November 4, 2025 22:43
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.

export: __url columns not exported for numeric metadata fields in --metadata_columns

3 participants