Skip to content

BUG: make report_diff_values returns consistent (ignoring terminal size) - #16065

Merged
pllim merged 2 commits into
astropy:mainfrom
neutrinoceros:utils/diff/diff_large_tables
Feb 20, 2024
Merged

pllim merged 2 commits into
astropy:mainfrom
neutrinoceros:utils/diff/diff_large_tables

Conversation

@neutrinoceros

Copy link
Copy Markdown
Contributor

Description

Fixes #14010 in a backportable fashion as suggested by @taldcroft. This puts the context manager in a decorator to minimize the diff.
Broader changes are to be discussed in #15828 and should probably be defered to the next major version.

  • By checking this box, the PR author has requested that maintainers do NOT use the "Squash and Merge" button. Maintainers should respect this when possible; however, the final decision is at the discretion of the maintainer that merges the PR.

@github-actions github-actions Bot added the utils label Feb 19, 2024
@github-actions

github-actions Bot commented Feb 19, 2024 •

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.

  • Do the proposed changes actually accomplish desired goals?
  • Do the proposed changes follow the Astropy coding guidelines?
  • Are tests added/updated as required? If so, do they follow the Astropy testing guidelines?
  • Are docs added/updated as required? If so, do they follow the Astropy documentation guidelines?
  • Is rebase and/or squash necessary? If so, please provide the author with appropriate instructions. Also see instructions for rebase and squash.
  • Did the CI pass? If no, are the failures related? If you need to run daily and weekly cron jobs as part of the PR, please apply the "Extra CI" label. Codestyle issues can be fixed by the bot.
  • Is a change log needed? If yes, did the change log check pass? If no, add the "no-changelog-entry-needed" label. If this is a manual backport, use the "skip-changelog-checks" label unless special changelog handling is necessary.
  • Is this a big PR that makes a "What's new?" entry worthwhile and if so, is (1) a "what's new" entry included in this PR and (2) the "whatsnew-needed" label applied?
  • At the time of adding the milestone, if the milestone set requires a backport to release branch(es), apply the appropriate "backport-X.Y.x" label(s) before merge.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Thank you for your draft pull request! Do you know that you can use [ci skip] or [skip ci] in your commit messages to skip running continuous integration tests until you are ready?

@neutrinoceros
neutrinoceros force-pushed the utils/diff/diff_large_tables branch from 89f1646 to 3456e6e Compare February 19, 2024 10:28
Comment thread astropy/utils/diff.py Resolved
@pllim pllim added this to the v6.1.0 milestone Feb 19, 2024
@neutrinoceros
neutrinoceros marked this pull request as ready for review February 20, 2024 05:37

@taldcroft taldcroft left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, just a few nits.

Comment thread astropy/utils/diff.py Resolved
Comment thread astropy/utils/tests/test_diff.py Outdated
colnames.insert(50, "test")
t2 = Table(names=colnames)

assert not report_diff_values(t1, t2)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just to be tidy I'd suggest catching the output in a StringIO() object like above. It feels not nice to be printing some huge diff to stdout in the test.

Comment thread docs/changes/utils/16065.bugfix.rst Outdated
@@ -0,0 +1 @@
Make ``report_diff_values`` returns consistent (ignoring terminal size).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
Make ``report_diff_values`` returns consistent (ignoring terminal size).
Update ``report_diff_values`` so the diff no longer depends on the console terminal size.

@neutrinoceros
neutrinoceros force-pushed the utils/diff/diff_large_tables branch from 3456e6e to 7eac388 Compare February 20, 2024 15:36
@neutrinoceros

Copy link
Copy Markdown
Contributor Author

@taldcroft thanks for your review ! I've addressed your comments.

@taldcroft taldcroft left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@taldcroft

Copy link
Copy Markdown
Member

@pllim - you marked this a 6.1.0. I think this version should be backport-able since it is pretty narrow and fixes a problem that is clearly a bug IMO.

@pllim pllim modified the milestones: v6.1.0, v6.0.1 Feb 20, 2024
@pllim
pllim merged commit c3c92f4 into astropy:main Feb 20, 2024
meeseeksmachine pushed a commit to meeseeksmachine/astropy that referenced this pull request Feb 20, 2024
@pllim

pllim commented Feb 20, 2024

Copy link
Copy Markdown
Member

OK it will be backported. Thanks, all!

pllim added a commit that referenced this pull request Feb 20, 2024
…065-on-v6.0.x

Backport PR #16065 on branch v6.0.x (BUG: make report_diff_values returns consistent (ignoring terminal size))
@neutrinoceros
neutrinoceros deleted the utils/diff/diff_large_tables branch February 20, 2024 18:36
d-giles referenced this pull request in d-giles/astropy-abdufork Jul 26, 2024
…ze) (#16065)

* TST: add a regression test for issue 14010

* BUG: make report_diff_values returns consistent (ignoring terminal size)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recommended way of comparing Tables (report_diff_values) depends on terminal width.

3 participants