Skip to content

Implement get_homogeneous_pages and select_homogeneous_pages#90

Open
mattalbr wants to merge 159 commits into
djrobstep:masterfrom
mattalbr:get_homogeneous_pages_experimentaiton
Open

Implement get_homogeneous_pages and select_homogeneous_pages#90
mattalbr wants to merge 159 commits into
djrobstep:masterfrom
mattalbr:get_homogeneous_pages_experimentaiton

Conversation

@mattalbr

@mattalbr mattalbr commented Jul 18, 2023

Copy link
Copy Markdown

The select version was super challenging to write, but we made it. Lots of type wrangling to get the query to work with orm entities. Doesn't work in 1.3, but neither does select(Book, Book.id) with a normal page. Figure it's probably pretty rare to be using select() and 1.3 anyway.

@mattalbr mattalbr marked this pull request as ready for review July 20, 2023 23:12
@mattalbr mattalbr changed the title Experiment with select_homogeneous_pages Implement get_homogeneous_pages and select_homogeneous_pages Jul 20, 2023
@acarapetis

Copy link
Copy Markdown
Collaborator

AFAIK using select with ORM entities was never officially supported in 1.3, so I think we're good there :)
I'd be perfectly happy with restricting new features to sqlalchemy 1.4+ or even 2+ anyway.

Full review coming soon when I have the time, thanks again :)

@mattalbr

mattalbr commented Aug 7, 2023

Copy link
Copy Markdown
Author

Just wanted to follow up @acarapetis for a review when you have the chance! Thanks!

@acarapetis

Copy link
Copy Markdown
Collaborator

@mattalbr Sorry for the delay on this, been a bit swamped. Hopefully will have time this weekend!

@ddorian

ddorian commented Sep 12, 2023

Copy link
Copy Markdown

Any updates to this?

@mattalbr

Copy link
Copy Markdown
Author

Hi Anthony, just wanted to ping here to see if you'll have time to review coming up!

@mattalbr

Copy link
Copy Markdown
Author

Hi @acarapetis, picking this back up, is there any way to get a review from you on this PR?

@acarapetis acarapetis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Took me a long while to get to this - hopefully it's still useful to you to get this merged.

Looks good overall - I've left a couple of minor comments.

Comment thread tests/test_paging.py
unpaged: list
gathered: deque
backwards: bool
page: Tuple[Union[MarkerLike, str], bool]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This type is confusing me and making pyright raise a bunch of errors in check_multiple_paging_*. I think it should just be page: MarkerLike?

Comment thread sqlakeyset/paging.py
backwards: bool,
orm: Literal[True],
dialect: Dialect,
page_identifier: Optional[int] = None,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There are page_identifier: Optional[int] parameters on a few functions in this module, but none of them seem to be used. Am I missing something, or they can be removed?

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.

3 participants