Skip to content

API: change default behavior in Table.pformat and Column.pformat and add (pending) deprecation to Table.pformat_all - #17184

Merged
taldcroft merged 1 commit into
astropy:mainfrom
neutrinoceros:table/depr/deprecate_pformat_all
Oct 24, 2024
Merged

taldcroft merged 1 commit into
astropy:mainfrom
neutrinoceros:table/depr/deprecate_pformat_all

Conversation

@neutrinoceros

@neutrinoceros neutrinoceros commented Oct 15, 2024 •

Copy link
Copy Markdown
Contributor

Description

Fixes #15828, replaces #17179

EDIT: Closes #17179

  • 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

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 table/depr/deprecate_pformat_all branch 2 times, most recently from b36726e to f881699 Compare October 15, 2024 18:21
@neutrinoceros neutrinoceros changed the title API: change default behavior in Table.pformat and Column.pformat and add (pending) deprecation to Table.pformat_all API: change default behavior in Table.pformat and Column.pformat and add (pending) deprecation to Table.pformat_all Oct 15, 2024
@neutrinoceros
neutrinoceros force-pushed the table/depr/deprecate_pformat_all branch from f881699 to 9b1db24 Compare October 15, 2024 18:23
@neutrinoceros
neutrinoceros marked this pull request as ready for review October 15, 2024 18:48
@taldcroft taldcroft added whatsnew-needed API change PRs and issues that change an existing API, possibly requiring a deprecation period labels Oct 15, 2024

@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 great, thanks! I just have some word-smithing suggestions. I think this should also get a What's new entry.

Comment thread astropy/table/column.py Outdated
Comment on lines +874 to +876
-1 (the default) implies no truncation
pass None to ensure the output doesn't exceed the limits
of current terminal.

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.

For this and other similar docstring changes:

Suggested change
-1 (the default) implies no truncation
pass None to ensure the output doesn't exceed the limits
of current terminal.
-1 (default) implies no limit, ``None`` implies using the
height of the current terminal.

Comment thread astropy/table/table.py Outdated

@deprecated(
since="7.0",
message="We are planning on deprecating Table.pformat_all",

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
message="We are planning on deprecating Table.pformat_all",
message="Table.pformat_all will be deprecated",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

the phrasing I used is borrowed from the only other pending deprecation (Table.show_in_browser). I'm also not sure it's worth doing a pending deprecation if we're 100% sure that it will be deprecated; why not just deprecate it now then ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

(I'm going to assume a direct deprecation is okay for this round of review, let me know if you want me to change it back)

Comment thread docs/changes/table/17184.api.rst Resolved
@neutrinoceros
neutrinoceros force-pushed the table/depr/deprecate_pformat_all branch from edde4df to e18a719 Compare October 16, 2024 07:48
@neutrinoceros
neutrinoceros force-pushed the table/depr/deprecate_pformat_all branch from e18a719 to 21fbd75 Compare October 16, 2024 08:32

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

Just some little documentation nits now, otherwise all good!

Comment thread astropy/table/column.py Resolved
Comment thread astropy/table/column.py Resolved
Comment thread docs/whatsnew/7.0.rst Resolved
@taldcroft

Copy link
Copy Markdown
Member

Needs a rebase. :-(

@neutrinoceros
neutrinoceros force-pushed the table/depr/deprecate_pformat_all branch from 222455d to 3a9d4cf Compare October 22, 2024 19:20
@neutrinoceros

Copy link
Copy Markdown
Contributor Author

suggestions integrated and branch rebased !

@taldcroft
taldcroft enabled auto-merge (squash) October 23, 2024 15:49
@taldcroft

Copy link
Copy Markdown
Member

Sorry, this needs a rebase as well. But now I have auto-merge enabled so it should go through!

@neutrinoceros
neutrinoceros force-pushed the table/depr/deprecate_pformat_all branch from 3a9d4cf to d852be3 Compare October 23, 2024 16:01
…add (pending) deprecation to Table.pformat_all
@neutrinoceros
neutrinoceros force-pushed the table/depr/deprecate_pformat_all branch from d852be3 to 778022f Compare October 23, 2024 16:17
@pllim

pllim commented Oct 23, 2024

Copy link
Copy Markdown
Member

@taldcroft , you need to approve for auto merge to happen. 😉

@neutrinoceros

neutrinoceros commented Oct 23, 2024 •

Copy link
Copy Markdown
Contributor Author

Something seems stuck, all required checks are green but auto-merge still didn't happen. I'll try to disable it an merge manually.

Update: whoops, once again, beaten by @pllim 😀

@pllim

pllim commented Oct 23, 2024

Copy link
Copy Markdown
Member

Well, if you keep the auto-merge, it would have merged as soon as approval is granted.

@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!

@taldcroft
taldcroft merged commit 04d2a63 into astropy:main Oct 24, 2024
@neutrinoceros
neutrinoceros deleted the table/depr/deprecate_pformat_all branch October 24, 2024 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API change PRs and issues that change an existing API, possibly requiring a deprecation period io.ascii table

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider changing the default behavior of Table.pformat() to be independent of the terminal

3 participants