Skip to content

Conversation

@josh-lynch
Copy link
Contributor

Description

PGCLI advertises the ability to configure a custom alias_map_file, enabling users to override table alias generation with predefined aliases of their choosing.

Prior to this change the use of the alias_map_file was bugged; the configured file was not used and users would continue to get the auto-generated table aliases.

This change plugs the configured alias_map_file into the alias generation process, enabling users to use/see their custom aliases.

Checklist

  • I've added this contribution to the changelog.rst.
  • I've added my name to the AUTHORS file (or it's already there).
  • I installed pre-commit hooks (pip install pre-commit && pre-commit install), and ran black on my code.
  • Please squash merge this pull request (uncheck if you'd like us to merge as multiple commits)

@josh-lynch
Copy link
Contributor Author

josh-lynch commented Feb 25, 2025

Hi @j-bennet

I've raised this PR to fix a small bug with pgcli (see description for details).

Tagging you here, apologies if this is not the standard procedure for requesting reviews, I checked the instructions on the FAQ and Develop tabs but didn't see this covered 😅

Copy link
Contributor

@j-bennet j-bennet left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for the fix. 🍒

@j-bennet
Copy link
Contributor

j-bennet commented Mar 5, 2025

@josh-lynch So looks like our integration tests are currently broken. I merged a PR to temporarily remove them, while I look into that: #1494.

You'll have to rebase your PR on top of main to pull in the change.

The test demonstrates a bug in the PGCompleter class where a configured
alias map file is not used to generate aliases.
Fixes a bug where this configuration was ignored.
Clarify the behaviour of generate_alias when an alias_map argument is
passed.
Test demonstrates passing an alias_map to generate_alias does not break
generation of aliases for tables not covered within the map file.
Credit where credit is due ;)
@josh-lynch josh-lynch force-pushed the bugfix.use-alias-map-file branch from 93cb0c9 to 37f56e3 Compare March 5, 2025 11:47
@josh-lynch
Copy link
Contributor Author

🙏 Thanks for the review @j-bennet

Can I also clarify the process/schedule for new releases of pgcli? I see it's been roughly 12 months since the last one and a few contributions have now built up unreleased.

@j-bennet
Copy link
Contributor

j-bennet commented Mar 5, 2025

Can I also clarify the process/schedule for new releases of pgcli? I see it's been roughly 12 months since the last one and a few contributions have now built up unreleased

There's no schedule. For myself, I usually wait for a few changes (3+) and then release. But I've released before with a single change too. I can release as soon as your PR goes in.

@j-bennet j-bennet merged commit 4f214f6 into dbcli:main Mar 5, 2025
7 checks passed
@josh-lynch
Copy link
Contributor Author

There's no schedule. For myself, I usually wait for a few changes (3+) and then release. But I've released before with a single change too. I can release as soon as your PR goes in.

That would be awesome. Thanks 🙌

@j-bennet
Copy link
Contributor

j-bennet commented Mar 6, 2025

4.2.0 is released.

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.

2 participants