Skip to content

Struct attrributes#268

Open
yfukai wants to merge 33 commits into
royerlab:mainfrom
yfukai:struct_attr
Open

Struct attrributes#268
yfukai wants to merge 33 commits into
royerlab:mainfrom
yfukai:struct_attr

Conversation

@yfukai
Copy link
Copy Markdown
Contributor

@yfukai yfukai commented Feb 20, 2026

Partially solves #194 by allowing pl.Struct saved and searched in graphs.
Assumes #262 merged.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 20, 2026

Codecov Report

❌ Patch coverage is 81.90955% with 36 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.56%. Comparing base (13f9ba8) to head (3759d9c).

Files with missing lines Patch % Lines
src/tracksdata/attrs.py 74.41% 10 Missing and 1 partial ⚠️
src/tracksdata/graph/_sql_graph.py 90.83% 6 Missing and 5 partials ⚠️
src/tracksdata/graph/_rustworkx_graph.py 41.17% 8 Missing and 2 partials ⚠️
src/tracksdata/utils/_dtypes.py 78.94% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #268      +/-   ##
==========================================
- Coverage   87.81%   87.56%   -0.25%     
==========================================
  Files          57       57              
  Lines        4998     5155     +157     
  Branches      877      908      +31     
==========================================
+ Hits         4389     4514     +125     
- Misses        384      409      +25     
- Partials      225      232       +7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@yfukai yfukai marked this pull request as ready for review February 26, 2026 02:51
@yfukai yfukai mentioned this pull request Feb 26, 2026
11 tasks
@yfukai yfukai marked this pull request as draft February 26, 2026 03:14
@yfukai
Copy link
Copy Markdown
Contributor Author

yfukai commented Feb 26, 2026

Maybe I should save the data field-wise in SQLGraph. Let me experiment in this way.

@JoOkuma
Copy link
Copy Markdown
Member

JoOkuma commented Feb 27, 2026

@yfukai, let me know when this is ready for review.

@yfukai
Copy link
Copy Markdown
Contributor Author

yfukai commented Mar 1, 2026

Thanks, it might take a while, but I'll continue working on this.

@yfukai yfukai marked this pull request as ready for review April 14, 2026 08:21
@yfukai
Copy link
Copy Markdown
Contributor Author

yfukai commented Apr 14, 2026

@JoOkuma I believe this is good to go! Sorry for the large PR.

@JoOkuma
Copy link
Copy Markdown
Member

JoOkuma commented Apr 21, 2026

@yfukai, I need more time to take a look at your PRs. I'll try to get them done before the end of the week.

@yfukai
Copy link
Copy Markdown
Contributor Author

yfukai commented May 28, 2026

Added additional comments! It would be great if you could review this, since this changes the database structure for a "struct"-type attributes @JoOkuma

Copy link
Copy Markdown
Member

@JoOkuma JoOkuma left a comment

Choose a reason for hiding this comment

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

Hi @yfukai, I haven't finished reviewing yet, but here are some comments.

I'm worried about the codebase's complexity. I'm taking my time to review this.

Comment thread src/tracksdata/attrs.py Outdated
Comment on lines +225 to +226
if isinstance(out, Attr):
out._append_field_path(name)
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.

Won't this if always be true according to the return value?

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.

Yeah I think it's guaranteed to be Attr before this block. Thanks!

Separator. Defaults to ``STRUCT_FIELD_SEP``.
"""
result: dict = {}
value = value or {}
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.

Are both value = value or {} and field_val or {} necessary? They seem a bit redundant

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 sorry for overlooking this. That's true! I fied this.

@yfukai
Copy link
Copy Markdown
Contributor Author

yfukai commented Jun 4, 2026

Sure, thanks @JoOkuma! Let me also try to reduce the complexity.

yfukai added 6 commits June 4, 2026 01:29
The previous commit (db35287) mistakenly deleted upstream/main's _SQLIDSet
scratch-table machinery, _create_id_scratch_table, the out_degree/copy
bound-variable handling, and the three scratch-table tests — they were diffed
against a stale fork main and wrongly treated as PR-added code. Restore them
verbatim from main; the struct-attr column-expansion simplification from the
previous commit is kept.
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