Skip to content

feat(db): transformation feeder methods - #1145

Open
amaltaro wants to merge 5 commits into
DIRACGrid:mainfrom
amaltaro:feat/1082-2-db
Open

amaltaro wants to merge 5 commits into
DIRACGrid:mainfrom
amaltaro:feat/1082-2-db

Conversation

@amaltaro

@amaltaro amaltaro commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Partially resolving #1082 (part 2/5)
Blocked by #1144
Superseds #1143

This pull request contains diracx-db-only changes. In summary:

Question: I feel like the diracx-db/src/diracx/db/sql/transformation/db.py module is becoming too large, with specifics of feeder, packer and probably others to come. I'd suggest breaking it similarly to how we did under diracx-core, where packer and feeder would have their own python module. Any thoughts?

result = await self.conn.execute(stmt)
return list(result.scalars().all())

async def get_feeder_columns(

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.

Can potentially be replaced by get_transformation(), from:
https://github.com/DIRACGrid/diracx/pull/1150/changes#diff-5a1e1a2b10303a0dc725d87e13772f68eb8f33b335591de07109bb83ec806fd9R95

It comes with some extra information, but I don't think it matters for the amount of transformations that would be retrieved. Thoughts?

@DIRACGridBot
DIRACGridBot marked this pull request as draft November 4, 2026 14:07
@amaltaro amaltaro closed this Nov 5, 2026
@amaltaro amaltaro reopened this Nov 5, 2026
@amaltaro

amaltaro commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

GitHub was lagging behind with my last commit, so I closed/reopened it to try to resolve that (which it did).

@amaltaro
amaltaro requested a review from chrisburr November 5, 2026 16:51
@amaltaro
amaltaro marked this pull request as ready for review November 5, 2026 16:51

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To make it consistent with the other db/sql/<domain> directories, could you move this function to db.py please?

db.py might grow fast and become very large at some point.
When that would happen, if it happens, we should reconsider the structure and make it consistent across all the <domain> (auth, resource_system, transformation) we have I think.

"were not Unassigned",
)

async def list_feedable_transformation_ids(self) -> list[UUID]:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't you reuse

AnyUUID: TypeAlias = UUID | uuid.UUID

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same comment everywhere you are using UUID directly

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.

Haa, definitely. I will have it updated very soon. Thanks

@DIRACGridBot
DIRACGridBot marked this pull request as draft November 6, 2026 13:57
@amaltaro
amaltaro requested a review from aldbr November 6, 2026 15:32
@amaltaro
amaltaro marked this pull request as ready for review November 6, 2026 15:32
aldbr
aldbr previously approved these changes Nov 6, 2026
@amaltaro

amaltaro commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

one of the unit tests in pytest-integration failed, apparently for:
"""
XFAIL diracx-routers/tests/test_generic.py::test_unavailable_db - TODO
"""

I will try to retrigger that pipeline.

@aldbr
aldbr dismissed their stale review November 6, 2026 17:12

a few more comments to add actually, sorry (coming soon)

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