Update rabbit in a hat node - #2384
Merged
Merged
Conversation
alicia-koh
marked this pull request as ready for review
April 30, 2026 01:22
alicia-koh
requested review from
SantanM,
csafreen,
p-hoffmann,
satish-a0 and
suwarnoong
as code owners
April 30, 2026 01:22
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the dataflow UI plugin to support a new “White Rabbit” node and reworks CSV loading + data mapping to consume scan metadata (instead of hard-coded source assumptions), aligning the backend node execution with the “rabbit in a hat” workflow.
Changes:
- Updated
NodeTypeenum (addsWHITERABBIT, renames the data-mapping node type value). - Added a shared
load_csv_from_storagehelper and refactored CSV node loading to use it. - Introduced
WhiteRabbitNodeand modifiedDataMappingNodeto use upstream scan metadata for sourcing tables (CSV/DB).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
plugins/flows/data_transformation/dataflow_ui_plugin/types.py |
Adds WHITERABBIT node type and changes DATAMAPPING node type value; updates DB table source value. |
plugins/flows/data_transformation/dataflow_ui_plugin/nodeutils/csvutils.py |
Adds load_csv_from_storage helper using SupabaseStorageAPI.download_file_to_path. |
plugins/flows/data_transformation/dataflow_ui_plugin/nodes.py |
Refactors CSV loading, adds WhiteRabbitNode, and reworks DataMappingNode to use scan metadata + new query generation structure. |
plugins/flows/data_transformation/dataflow_ui_plugin/flow.py |
Treats WHITERABBIT as a no-input node during execution; minor log message update. |
Zhimin-arya
reviewed
Apr 30, 2026
…ub.com/OHDSI/Data2Evidence into alicia-koh/update-rabbit-in-a-hat-node
Zhimin-arya
approved these changes
May 4, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (2)
plugins/flows/data_transformation/dataflow_ui_plugin/nodes.py:832
- DataMappingNode.test now requires an _input argument, but execute_node_task() calls _node.test(task_run_context) when test mode is enabled. This will raise a TypeError for DataMappingNode in test mode. Either keep the old signature for test(), or update execute_node_task() to pass the incoming input to test() (mirroring how task() is invoked).
def test(self, _input: dict[str, Result], task_run_context) -> Result:
return self.task(_input, task_run_context)
def task(self, _input: dict[str, Result], task_run_context) -> Result:
try:
plugins/flows/data_transformation/dataflow_ui_plugin/nodes.py:836
- DataMappingNode.task assumes there is at least one incoming node and does
next(iter(_input.values()))to fetch scan metadata. If the node is executed without an incoming WhiteRabbitNode (or with an empty input dict), this will raise StopIteration and fail the flow without a helpful error. Add an explicit check for required input and return a clear Result(error=True, ...) when missing.
table_mapping = self.etl_mapping.table.edges
target_table_list = set(t.targetHandle for t in table_mapping)
scan_metadata = next(iter(_input.values())).result
Comment on lines
14
to
20
| DBREADER = "db_reader_node" | ||
| DBWRITER = "db_writer_node" | ||
| SQLQUERY = "sql_query_node" | ||
| DATAMAPPING = "data_mapping_node" | ||
| WHITERABBIT = "white_rabbit_node" | ||
| DATAMAPPING = "rabbit_in_a_hat" | ||
| CONCEPTMAPPING = "concept_mapping_node" | ||
| SUBFLOW = "subflow" |
| class TableSourceType(str, Enum): | ||
| CSV = "csv" | ||
| DB = "database" | ||
| DB = "postgresql" |
Comment on lines
+568
to
+576
|
|
||
| def test(self, task_run_context) -> Result: | ||
| return Result(False, "White Rabbit Node Test Successful", self, task_run_context) | ||
|
|
||
| def task(self, task_run_context) -> Result: | ||
| try: | ||
| scan_metadata = self.scan_metadata | ||
| scan_metadata["node_id"] = self.id | ||
| return Result(False, scan_metadata, self, task_run_context) |
Comment on lines
564
to
588
| @@ -571,33 +586,32 @@ def __init__(self, name, _node): | |||
| # Fail node generation if scan report data validation fails | |||
| self.etl_mapping = DataMappingType(**_node["data"]) | |||
|
|
|||
csafreen
approved these changes
May 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge Checklist
Please cross check this list if additions / modifications needs to be done on top of your core changes and tick them off. Reviewer can as well glance through and help the developer if something is missed out.
developbranch)