-
Notifications
You must be signed in to change notification settings - Fork 136
export: support export of URL for non-string values #1926
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
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>
jameshadfield
left a comment
There was a problem hiding this 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 |
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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_attrsThere was a problem hiding this comment.
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.)
There was a problem hiding this comment.
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'}c321f26 to
b89691f
Compare
Description of proposed changes
Resolves #1925
Checklist