Skip to content

Conversation

@timb07
Copy link
Contributor

@timb07 timb07 commented Jun 26, 2025

This change makes PostBackfillBatchCallback public, so that when Psycopack is instantiated with a post_backfill_batch_callback argument, type checking the argument is possible.

@github-actions
Copy link

Coverage Report Results

Name Stmts Miss Branch BrPart Cover
src/psycopack/__init__.py 6 0 0 0 100%
src/psycopack/_commands.py 111 0 8 0 100%
src/psycopack/_conn.py 5 0 0 0 100%
src/psycopack/_const.py 3 0 0 0 100%
src/psycopack/_cur.py 24 0 2 0 100%
src/psycopack/_identifiers.py 12 0 2 0 100%
src/psycopack/_introspect.py 160 0 16 0 100%
src/psycopack/_logging.py 2 0 0 0 100%
src/psycopack/_psycopg.py 5 0 0 0 100%
src/psycopack/_registry.py 58 0 6 0 100%
src/psycopack/_repack.py 354 0 118 0 100%
src/psycopack/_tracker.py 165 0 36 0 100%
tests/conftest.py 19 0 0 0 100%
tests/factories.py 40 0 8 0 100%
tests/test_cur.py 20 0 2 0 100%
tests/test_fixtures.py 5 0 0 0 100%
tests/test_package.py 3 0 0 0 100%
tests/test_repack.py 702 0 0 0 100%
TOTAL 1694 0 198 0 100%

1 empty file skipped.

Copy link

@s-cooper18 s-cooper18 left a comment

Choose a reason for hiding this comment

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

Makes sense

NoReferencesPrivilege,
NoReferringTableOwnership,
NotTableOwner,
PostBackfillBatchCallback,
Copy link

@flpcury flpcury Jun 26, 2025

Choose a reason for hiding this comment

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

I'm not sure PostBackfillBatchCallback itself needs to be public. I'd assume that type checking would work regardless of this change. What kind of issue has popped up? I wonder if it could be a red herring

One thing I think would be useful to make public is _introspect.BackfillBatch, since that's something users could use when implementing a post backfill batch callback. It's already public, I'm a dummy

Copy link
Contributor Author

@timb07 timb07 Jun 26, 2025

Choose a reason for hiding this comment

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

I used PostBackfillBatchCallback here.

Perhaps the justification for it in the description is a bit weak. It's useful if you're declaring your own function that takes an argument with type PostBackfillBatchCallback and passes that through to Psycopack.

One thing I think would be useful to make public is _introspect.BackfillBatch, since that's something users could use when implementing a post backfill batch callback.

It is already :)

Copy link

Choose a reason for hiding this comment

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

Ah got it, you want to use for a type annotation 👍 Makes sense

It is already :)

Yeah I noticed after I wrote it 🤦

@timb07 timb07 merged commit 2e0f5e4 into main Jun 26, 2025
9 checks passed
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.

4 participants