Title: Add self.upstream property for pre-restricted ancestor access in make() · Issue #1424 · datajoint/datajoint-python · GitHub
Open Graph Title: Add self.upstream property for pre-restricted ancestor access in make() · Issue #1424 · datajoint/datajoint-python
X Title: Add self.upstream property for pre-restricted ancestor access in make() · Issue #1424 · datajoint/datajoint-python
Description: Summary Inside make(), provide self.upstream — a pre-constructed Diagram.trace(self & key) — as a property on auto-populated tables. This gives make() convenient, provenance-safe access to pre-restricted ancestor table expressions. Conte...
Open Graph Description: Summary Inside make(), provide self.upstream — a pre-constructed Diagram.trace(self & key) — as a property on auto-populated tables. This gives make() convenient, provenance-safe access to pre-rest...
X Description: Summary Inside make(), provide self.upstream — a pre-constructed Diagram.trace(self & key) — as a property on auto-populated tables. This gives make() convenient, provenance-safe access to pre-...
Opengraph URL: https://github.com/datajoint/datajoint-python/issues/1424
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add self.upstream property for pre-restricted ancestor access in make()","articleBody":"## Summary\n\nInside `make()`, provide `self.upstream` — a pre-constructed `Diagram.trace(self \u0026 key)` — as a property on auto-populated tables. This gives `make()` convenient, provenance-safe access to pre-restricted ancestor table expressions.\n\n## Context\n\nDiscussion: #1232\nDepends on: #1423 (`Diagram.trace()`)\nRelated: #242 (farfetch)\n\n## Design\n\nThe `make(self, key)` signature stays unchanged. `self.upstream` is simply a new property available during `make()` execution:\n\n```python\ndef make(self, key):\n # Read from upstream — pre-restricted by key\n session_date = self.upstream[Session].fetch1(\"session_date\")\n traces = self.upstream[ExtractTraces].to_arrays(\"trace\")\n\n # All query operators work — upstream[Table] returns a QueryExpression\n self.upstream[Session].aggr(self.upstream[Scan], n='count(scan_id)')\n\n # Write to self\n self.insert1({**key, \"result\": compute(traces)})\n```\n\n**Read from `self.upstream`, write to `self`.** The read/write boundary is the provenance boundary.\n\n- `self.upstream` only exposes declared ancestors and their part tables — requesting anything else raises an error\n- `key` is passed as before — no signature changes, no redundancy\n- `make_kwargs` work unchanged\n- Existing code that doesn't use `self.upstream` is completely unaffected\n\n### Implementation\n\n- The framework sets `self.upstream = Diagram.trace(self \u0026 key)` before calling `make()`\n- `self.upstream[TableClass]` returns pre-restricted `QueryExpression` objects with full fetch capabilities\n- Requesting a table outside the declared ancestor graph raises `DataJointError`","author":{"url":"https://github.com/dimitri-yatsenko","@type":"Person","name":"dimitri-yatsenko"},"datePublished":"2026-04-04T00:50:03.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/1424/datajoint-python/issues/1424"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:caad96d8-7e58-45b9-120d-e7b32f8ee02d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CBCC:3C5CB:1B970B:27670F:6A4E6596 |
| html-safe-nonce | e2b4ed480247a5751cd10a82e9f51c7cc594fe48a9006f7acc0469f8f3e78eb3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQkNDOjNDNUNCOjFCOTcwQjoyNzY3MEY6NkE0RTY1OTYiLCJ2aXNpdG9yX2lkIjoiMzMyNDY5NDk2Mzk3NTc3NTYzOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b7f66ac0b66bd6da319ee12171d5beb4521c91e65a9a01db5ae00158dabb22f6 |
| hovercard-subject-tag | issue:4202808175 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/datajoint/datajoint-python/1424/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5ba081d7c0dc43d923b78395d303cca68d49e0324e8300d60900e5f984597577/datajoint/datajoint-python/issues/1424 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5ba081d7c0dc43d923b78395d303cca68d49e0324e8300d60900e5f984597577/datajoint/datajoint-python/issues/1424 |
| og:image:alt | Summary Inside make(), provide self.upstream — a pre-constructed Diagram.trace(self & key) — as a property on auto-populated tables. This gives make() convenient, provenance-safe access to pre-rest... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dimitri-yatsenko |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| turbo-cache-control | no-preview |
| go-import | github.com/datajoint/datajoint-python git https://github.com/datajoint/datajoint-python.git |
| octolytics-dimension-user_id | 2375501 |
| octolytics-dimension-user_login | datajoint |
| octolytics-dimension-repository_id | 5866704 |
| octolytics-dimension-repository_nwo | datajoint/datajoint-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 5866704 |
| octolytics-dimension-repository_network_root_nwo | datajoint/datajoint-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width