Flowfile 0.4.1__py3-none-any.whl → 0.5.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- build_backends/main.py +25 -22
- build_backends/main_prd.py +10 -19
- flowfile/__init__.py +179 -73
- flowfile/__main__.py +10 -7
- flowfile/api.py +52 -59
- flowfile/web/__init__.py +14 -9
- flowfile/web/static/assets/AdminView-49392a9a.js +713 -0
- flowfile/web/static/assets/AdminView-f53bad23.css +129 -0
- flowfile/web/static/assets/CloudConnectionView-36bcd6df.css +72 -0
- flowfile/web/static/assets/{CloudConnectionManager-d3248f8d.js → CloudConnectionView-f13f202b.js} +11 -11
- flowfile/web/static/assets/{CloudStorageReader-d65bf041.js → CloudStorageReader-0023d4a5.js} +10 -8
- flowfile/web/static/assets/{CloudStorageReader-29d14fcc.css → CloudStorageReader-24c54524.css} +27 -27
- flowfile/web/static/assets/{CloudStorageWriter-b0ee067f.css → CloudStorageWriter-60547855.css} +26 -26
- flowfile/web/static/assets/{CloudStorageWriter-e83be3ed.js → CloudStorageWriter-8e781e11.js} +10 -8
- flowfile/web/static/assets/{ColumnSelector-47996a16.css → ColumnSelector-371637fb.css} +2 -2
- flowfile/web/static/assets/{ColumnSelector-cce661cf.js → ColumnSelector-8ad68ea9.js} +3 -5
- flowfile/web/static/assets/{ContextMenu-c13f91d0.css → ContextMenu-26d4dd27.css} +6 -6
- flowfile/web/static/assets/{ContextMenu-11a4652a.js → ContextMenu-31ee57f0.js} +3 -3
- flowfile/web/static/assets/{ContextMenu-160afb08.js → ContextMenu-69a74055.js} +3 -3
- flowfile/web/static/assets/{ContextMenu-cf18d2cc.js → ContextMenu-8e2051c6.js} +3 -3
- flowfile/web/static/assets/{ContextMenu-4c74eef1.css → ContextMenu-8ec1729e.css} +6 -6
- flowfile/web/static/assets/{ContextMenu-63cfa99b.css → ContextMenu-9b310c60.css} +6 -6
- flowfile/web/static/assets/{CrossJoin-d395d38c.js → CrossJoin-03df6938.js} +12 -10
- flowfile/web/static/assets/{CrossJoin-1119d18e.css → CrossJoin-71b4cc10.css} +20 -20
- flowfile/web/static/assets/CustomNode-59e99a86.css +32 -0
- flowfile/web/static/assets/{CustomNode-b812dc0b.js → CustomNode-8479239b.js} +36 -24
- flowfile/web/static/assets/{DatabaseConnectionSettings-7000bf2c.js → DatabaseConnectionSettings-869e3efd.js} +5 -4
- flowfile/web/static/assets/{DatabaseConnectionSettings-0c04b2e5.css → DatabaseConnectionSettings-e91df89a.css} +13 -13
- flowfile/web/static/assets/{DatabaseReader-ae61773c.css → DatabaseReader-36898a00.css} +24 -24
- flowfile/web/static/assets/{DatabaseReader-4f035d0c.js → DatabaseReader-c58b9552.js} +25 -15
- flowfile/web/static/assets/DatabaseView-6655afd6.css +57 -0
- flowfile/web/static/assets/{DatabaseManager-9662ec5b.js → DatabaseView-d26a9140.js} +11 -11
- flowfile/web/static/assets/{DatabaseWriter-2f570e53.css → DatabaseWriter-217a99f1.css} +19 -19
- flowfile/web/static/assets/{DatabaseWriter-f65dcd54.js → DatabaseWriter-4d05ddc7.js} +17 -10
- flowfile/web/static/assets/{designer-e3c150ec.css → DesignerView-a6d0ee84.css} +629 -538
- flowfile/web/static/assets/{designer-f3656d8c.js → DesignerView-e6f5c0e8.js} +1214 -3209
- flowfile/web/static/assets/{documentation-52b241e7.js → DocumentationView-2e78ef1b.js} +5 -5
- flowfile/web/static/assets/{documentation-12216a74.css → DocumentationView-fd46c656.css} +7 -7
- flowfile/web/static/assets/{ExploreData-2d0cf4db.css → ExploreData-10c5acc8.css} +13 -12
- flowfile/web/static/assets/{ExploreData-94c43dfc.js → ExploreData-7b54caca.js} +18 -9
- flowfile/web/static/assets/{ExternalSource-ac04b3cc.js → ExternalSource-3fa399b2.js} +9 -7
- flowfile/web/static/assets/{ExternalSource-e37b6275.css → ExternalSource-47ab05a3.css} +17 -17
- flowfile/web/static/assets/Filter-7494ea97.css +48 -0
- flowfile/web/static/assets/Filter-8cbbdbf3.js +287 -0
- flowfile/web/static/assets/{Formula-bb96803d.css → Formula-53d58c43.css} +7 -7
- flowfile/web/static/assets/{Formula-71472193.js → Formula-aac42b1e.js} +13 -11
- flowfile/web/static/assets/{FuzzyMatch-1010f966.css → FuzzyMatch-ad6361d6.css} +68 -69
- flowfile/web/static/assets/{FuzzyMatch-b317f631.js → FuzzyMatch-cd9bbfca.js} +12 -10
- flowfile/web/static/assets/{Pivot-cf333e3d.css → GraphSolver-c24dec17.css} +5 -5
- flowfile/web/static/assets/{GraphSolver-754a234f.js → GraphSolver-c7e6780e.js} +13 -11
- flowfile/web/static/assets/{GroupBy-6c6f9802.js → GroupBy-93c5d22b.js} +9 -7
- flowfile/web/static/assets/{GroupBy-b9505323.css → GroupBy-be7ac0bf.css} +10 -10
- flowfile/web/static/assets/{Join-fd79b451.css → Join-28b5e18f.css} +22 -22
- flowfile/web/static/assets/{Join-a1b800be.js → Join-a19b2de2.js} +13 -11
- flowfile/web/static/assets/LoginView-0df4ed0a.js +134 -0
- flowfile/web/static/assets/LoginView-d325d632.css +172 -0
- flowfile/web/static/assets/ManualInput-3702e677.css +293 -0
- flowfile/web/static/assets/{ManualInput-a9640276.js → ManualInput-8d3374b2.js} +170 -116
- flowfile/web/static/assets/{MultiSelect-97213888.js → MultiSelect-ad1b6243.js} +2 -2
- flowfile/web/static/assets/{MultiSelect.vue_vue_type_script_setup_true_lang-6ffe088a.js → MultiSelect.vue_vue_type_script_setup_true_lang-e278950d.js} +1 -1
- flowfile/web/static/assets/NodeDesigner-40b647c9.js +2610 -0
- flowfile/web/static/assets/NodeDesigner-5f53be3f.css +1429 -0
- flowfile/web/static/assets/{NumericInput-e638088a.js → NumericInput-7100234c.js} +2 -2
- flowfile/web/static/assets/{NumericInput.vue_vue_type_script_setup_true_lang-90eb2cba.js → NumericInput.vue_vue_type_script_setup_true_lang-5130219f.js} +5 -2
- flowfile/web/static/assets/{Output-ddc9079f.css → Output-35e97000.css} +6 -6
- flowfile/web/static/assets/{Output-76750610.js → Output-f5efd2aa.js} +60 -38
- flowfile/web/static/assets/{GraphSolver-f0cb7bfb.css → Pivot-0eda81b4.css} +5 -5
- flowfile/web/static/assets/{Pivot-7814803f.js → Pivot-d981d23c.js} +11 -9
- flowfile/web/static/assets/PivotValidation-0e905b1a.css +13 -0
- flowfile/web/static/assets/{PivotValidation-f92137d2.js → PivotValidation-39386e95.js} +3 -3
- flowfile/web/static/assets/PivotValidation-41b57ad6.css +13 -0
- flowfile/web/static/assets/{PivotValidation-76dd431a.js → PivotValidation-63de1f73.js} +3 -3
- flowfile/web/static/assets/{PolarsCode-650322d1.css → PolarsCode-2b1f1f23.css} +4 -4
- flowfile/web/static/assets/{PolarsCode-889c3008.js → PolarsCode-f9d69217.js} +18 -9
- flowfile/web/static/assets/PopOver-b22f049e.js +939 -0
- flowfile/web/static/assets/PopOver-d96599db.css +33 -0
- flowfile/web/static/assets/{Read-6b17491f.css → Read-36e7bd51.css} +12 -12
- flowfile/web/static/assets/{Read-637b72a7.js → Read-aec2e377.js} +83 -105
- flowfile/web/static/assets/{RecordCount-2b050c41.js → RecordCount-78ed6845.js} +6 -4
- flowfile/web/static/assets/{RecordId-81df7784.js → RecordId-2156e890.js} +8 -6
- flowfile/web/static/assets/{SQLQueryComponent-36cef432.css → SQLQueryComponent-1c2f26b4.css} +5 -5
- flowfile/web/static/assets/{SQLQueryComponent-88dcfe53.js → SQLQueryComponent-48c72f5b.js} +3 -3
- flowfile/web/static/assets/{Sample-258ad2a9.js → Sample-1352ca74.js} +6 -4
- flowfile/web/static/assets/SecretSelector-22b5ff89.js +113 -0
- flowfile/web/static/assets/SecretSelector-6329f743.css +43 -0
- flowfile/web/static/assets/{SecretManager-2a2cb7e2.js → SecretsView-17df66ee.js} +35 -36
- flowfile/web/static/assets/SecretsView-aa291340.css +38 -0
- flowfile/web/static/assets/{Select-850215fd.js → Select-0aee4c54.js} +9 -7
- flowfile/web/static/assets/{SettingsSection-55bae608.js → SettingsSection-0784e157.js} +3 -3
- flowfile/web/static/assets/{SettingsSection-71e6b7e3.css → SettingsSection-07fbbc39.css} +4 -4
- flowfile/web/static/assets/{SettingsSection-5c696bee.css → SettingsSection-26fe48d4.css} +4 -4
- flowfile/web/static/assets/{SettingsSection-2e4d03c4.css → SettingsSection-8f980839.css} +4 -4
- flowfile/web/static/assets/{SettingsSection-0e8d9123.js → SettingsSection-cd341bb6.js} +3 -3
- flowfile/web/static/assets/{SettingsSection-29b4fa6b.js → SettingsSection-f2002a6d.js} +3 -3
- flowfile/web/static/assets/{SingleSelect-bebd408b.js → SingleSelect-460cc0ea.js} +2 -2
- flowfile/web/static/assets/{SingleSelect.vue_vue_type_script_setup_true_lang-6093741c.js → SingleSelect.vue_vue_type_script_setup_true_lang-30741bb2.js} +1 -1
- flowfile/web/static/assets/{SliderInput-6a05ab61.js → SliderInput-5d926864.js} +7 -4
- flowfile/web/static/assets/SliderInput-f2e4f23c.css +4 -0
- flowfile/web/static/assets/{Sort-10ab48ed.js → Sort-3cdc971b.js} +9 -7
- flowfile/web/static/assets/{Unique-f9fb0809.css → Sort-8a871341.css} +10 -10
- flowfile/web/static/assets/{TextInput-df9d6259.js → TextInput-a2d0bfbd.js} +2 -2
- flowfile/web/static/assets/{TextInput.vue_vue_type_script_setup_true_lang-000e1178.js → TextInput.vue_vue_type_script_setup_true_lang-abad1ca2.js} +5 -2
- flowfile/web/static/assets/{TextToRows-5d2c1190.css → TextToRows-12afb4f4.css} +10 -10
- flowfile/web/static/assets/{TextToRows-6c2d93d8.js → TextToRows-918945f7.js} +11 -10
- flowfile/web/static/assets/{ToggleSwitch-0ff7ac52.js → ToggleSwitch-f0ef5196.js} +2 -2
- flowfile/web/static/assets/{ToggleSwitch.vue_vue_type_script_setup_true_lang-c6dc3029.js → ToggleSwitch.vue_vue_type_script_setup_true_lang-5605c793.js} +1 -1
- flowfile/web/static/assets/{UnavailableFields-5edd5322.css → UnavailableFields-54d2f518.css} +6 -6
- flowfile/web/static/assets/{UnavailableFields-1bab97cb.js → UnavailableFields-bdad6144.js} +4 -4
- flowfile/web/static/assets/{Union-af6c3d9b.css → Union-d6a8d7d5.css} +7 -7
- flowfile/web/static/assets/{Union-b563478a.js → Union-e8ab8c86.js} +8 -6
- flowfile/web/static/assets/{Unique-f90db5db.js → Unique-8cd4f976.js} +13 -22
- flowfile/web/static/assets/{Sort-3643d625.css → Unique-9fb2f567.css} +10 -10
- flowfile/web/static/assets/{Unpivot-1e422df3.css → Unpivot-710a2948.css} +7 -7
- flowfile/web/static/assets/{Unpivot-bcb0025f.js → Unpivot-8da14095.js} +10 -8
- flowfile/web/static/assets/{UnpivotValidation-c4e73b04.js → UnpivotValidation-6f7d89ff.js} +3 -3
- flowfile/web/static/assets/UnpivotValidation-d5ca3b7b.css +13 -0
- flowfile/web/static/assets/{VueGraphicWalker-bb8535e2.js → VueGraphicWalker-3fb312e1.js} +4 -4
- flowfile/web/static/assets/{VueGraphicWalker-ed5ab88b.css → VueGraphicWalker-430f0b86.css} +1 -1
- flowfile/web/static/assets/{api-4c8e3822.js → api-24483f0d.js} +1 -1
- flowfile/web/static/assets/{api-2d6adc4f.js → api-8b81fa73.js} +1 -1
- flowfile/web/static/assets/{dropDown-35135ba8.css → dropDown-3d8dc5fa.css} +40 -40
- flowfile/web/static/assets/{dropDown-1bca8a74.js → dropDown-ac0fda9d.js} +3 -3
- flowfile/web/static/assets/{fullEditor-2985687e.js → fullEditor-5497a84a.js} +11 -10
- flowfile/web/static/assets/{fullEditor-178376bb.css → fullEditor-a0be62b3.css} +74 -62
- flowfile/web/static/assets/{genericNodeSettings-924759c7.css → genericNodeSettings-3b2507ea.css} +10 -10
- flowfile/web/static/assets/{genericNodeSettings-0476ba4e.js → genericNodeSettings-99014e1d.js} +5 -5
- flowfile/web/static/assets/index-07dda503.js +38 -0
- flowfile/web/static/assets/index-3ba44389.js +2696 -0
- flowfile/web/static/assets/{index-50508d4d.css → index-e6289dd0.css} +1945 -569
- flowfile/web/static/assets/{index-246f201c.js → index-fb6493ae.js} +41626 -40869
- flowfile/web/static/assets/node.types-2c15bb7e.js +82 -0
- flowfile/web/static/assets/nodeInput-0eb13f1a.js +2 -0
- flowfile/web/static/assets/{outputCsv-d686eeaf.js → outputCsv-8f8ba42d.js} +3 -3
- flowfile/web/static/assets/outputCsv-b9a072af.css +2499 -0
- flowfile/web/static/assets/{outputExcel-8809ea2f.js → outputExcel-393f4fef.js} +3 -3
- flowfile/web/static/assets/{outputExcel-b41305c0.css → outputExcel-f5d272b2.css} +26 -26
- flowfile/web/static/assets/{outputParquet-53ba645a.js → outputParquet-07c81f65.js} +4 -4
- flowfile/web/static/assets/outputParquet-54597c3c.css +4 -0
- flowfile/web/static/assets/{readCsv-053bf97b.js → readCsv-07f6d9ad.js} +21 -20
- flowfile/web/static/assets/{readCsv-bca3ed53.css → readCsv-3bfac4c3.css} +15 -15
- flowfile/web/static/assets/{readExcel-e1b381ea.css → readExcel-3db6b763.css} +13 -13
- flowfile/web/static/assets/{readExcel-ad531eab.js → readExcel-ed69bc8f.js} +10 -12
- flowfile/web/static/assets/{readParquet-cee068e2.css → readParquet-c5244ad5.css} +4 -4
- flowfile/web/static/assets/{readParquet-58e899a1.js → readParquet-e3ed4528.js} +4 -7
- flowfile/web/static/assets/secrets.api-002e7d7e.js +65 -0
- flowfile/web/static/assets/{selectDynamic-b38de2ba.js → selectDynamic-80b92899.js} +5 -5
- flowfile/web/static/assets/{selectDynamic-aa913ff4.css → selectDynamic-f2fb394f.css} +21 -20
- flowfile/web/static/assets/{vue-codemirror.esm-db9b8936.js → vue-codemirror.esm-0965f39f.js} +31 -637
- flowfile/web/static/assets/{vue-content-loader.es-b5f3ac30.js → vue-content-loader.es-c506ad97.js} +1 -1
- flowfile/web/static/index.html +2 -2
- {flowfile-0.4.1.dist-info → flowfile-0.5.3.dist-info}/METADATA +4 -4
- flowfile-0.5.3.dist-info/RECORD +402 -0
- {flowfile-0.4.1.dist-info → flowfile-0.5.3.dist-info}/WHEEL +1 -1
- {flowfile-0.4.1.dist-info → flowfile-0.5.3.dist-info}/entry_points.txt +1 -0
- flowfile_core/__init__.py +13 -3
- flowfile_core/auth/jwt.py +51 -16
- flowfile_core/auth/models.py +32 -7
- flowfile_core/auth/password.py +89 -0
- flowfile_core/auth/secrets.py +8 -6
- flowfile_core/configs/__init__.py +9 -7
- flowfile_core/configs/flow_logger.py +15 -14
- flowfile_core/configs/node_store/__init__.py +72 -4
- flowfile_core/configs/node_store/nodes.py +155 -172
- flowfile_core/configs/node_store/user_defined_node_registry.py +108 -27
- flowfile_core/configs/settings.py +28 -15
- flowfile_core/database/connection.py +7 -6
- flowfile_core/database/init_db.py +96 -2
- flowfile_core/database/models.py +3 -1
- flowfile_core/fileExplorer/__init__.py +17 -0
- flowfile_core/fileExplorer/funcs.py +123 -57
- flowfile_core/fileExplorer/utils.py +10 -11
- flowfile_core/flowfile/_extensions/real_time_interface.py +10 -8
- flowfile_core/flowfile/analytics/analytics_processor.py +27 -24
- flowfile_core/flowfile/analytics/graphic_walker.py +11 -12
- flowfile_core/flowfile/analytics/utils.py +1 -1
- flowfile_core/flowfile/code_generator/code_generator.py +391 -279
- flowfile_core/flowfile/connection_manager/_connection_manager.py +6 -5
- flowfile_core/flowfile/connection_manager/models.py +1 -1
- flowfile_core/flowfile/database_connection_manager/db_connections.py +60 -44
- flowfile_core/flowfile/database_connection_manager/models.py +1 -1
- flowfile_core/flowfile/extensions.py +17 -12
- flowfile_core/flowfile/flow_data_engine/cloud_storage_reader.py +34 -32
- flowfile_core/flowfile/flow_data_engine/create/funcs.py +152 -103
- flowfile_core/flowfile/flow_data_engine/flow_data_engine.py +526 -477
- flowfile_core/flowfile/flow_data_engine/flow_file_column/interface.py +2 -2
- flowfile_core/flowfile/flow_data_engine/flow_file_column/main.py +92 -52
- flowfile_core/flowfile/flow_data_engine/flow_file_column/polars_type.py +12 -11
- flowfile_core/flowfile/flow_data_engine/flow_file_column/type_registry.py +6 -6
- flowfile_core/flowfile/flow_data_engine/flow_file_column/utils.py +26 -30
- flowfile_core/flowfile/flow_data_engine/fuzzy_matching/prepare_for_fuzzy_match.py +43 -32
- flowfile_core/flowfile/flow_data_engine/join/__init__.py +1 -1
- flowfile_core/flowfile/flow_data_engine/join/utils.py +11 -9
- flowfile_core/flowfile/flow_data_engine/join/verify_integrity.py +15 -11
- flowfile_core/flowfile/flow_data_engine/pivot_table.py +5 -7
- flowfile_core/flowfile/flow_data_engine/polars_code_parser.py +95 -82
- flowfile_core/flowfile/flow_data_engine/read_excel_tables.py +66 -65
- flowfile_core/flowfile/flow_data_engine/sample_data.py +27 -21
- flowfile_core/flowfile/flow_data_engine/subprocess_operations/__init__.py +1 -1
- flowfile_core/flowfile/flow_data_engine/subprocess_operations/models.py +13 -11
- flowfile_core/flowfile/flow_data_engine/subprocess_operations/subprocess_operations.py +360 -191
- flowfile_core/flowfile/flow_data_engine/threaded_processes.py +8 -8
- flowfile_core/flowfile/flow_data_engine/utils.py +101 -67
- flowfile_core/flowfile/flow_graph.py +1011 -561
- flowfile_core/flowfile/flow_graph_utils.py +31 -49
- flowfile_core/flowfile/flow_node/flow_node.py +332 -232
- flowfile_core/flowfile/flow_node/models.py +54 -41
- flowfile_core/flowfile/flow_node/schema_callback.py +14 -19
- flowfile_core/flowfile/graph_tree/graph_tree.py +41 -41
- flowfile_core/flowfile/handler.py +82 -32
- flowfile_core/flowfile/manage/compatibility_enhancements.py +493 -47
- flowfile_core/flowfile/manage/io_flowfile.py +391 -0
- flowfile_core/flowfile/node_designer/__init__.py +15 -13
- flowfile_core/flowfile/node_designer/_type_registry.py +34 -37
- flowfile_core/flowfile/node_designer/custom_node.py +162 -36
- flowfile_core/flowfile/node_designer/ui_components.py +136 -35
- flowfile_core/flowfile/schema_callbacks.py +77 -54
- flowfile_core/flowfile/setting_generator/__init__.py +0 -1
- flowfile_core/flowfile/setting_generator/setting_generator.py +6 -5
- flowfile_core/flowfile/setting_generator/settings.py +72 -55
- flowfile_core/flowfile/sources/external_sources/base_class.py +12 -10
- flowfile_core/flowfile/sources/external_sources/custom_external_sources/external_source.py +27 -17
- flowfile_core/flowfile/sources/external_sources/custom_external_sources/sample_users.py +9 -9
- flowfile_core/flowfile/sources/external_sources/factory.py +0 -1
- flowfile_core/flowfile/sources/external_sources/sql_source/models.py +45 -31
- flowfile_core/flowfile/sources/external_sources/sql_source/sql_source.py +198 -73
- flowfile_core/flowfile/sources/external_sources/sql_source/utils.py +250 -196
- flowfile_core/flowfile/util/calculate_layout.py +9 -13
- flowfile_core/flowfile/util/execution_orderer.py +25 -17
- flowfile_core/flowfile/util/node_skipper.py +4 -4
- flowfile_core/flowfile/utils.py +19 -21
- flowfile_core/main.py +26 -19
- flowfile_core/routes/auth.py +284 -11
- flowfile_core/routes/cloud_connections.py +25 -25
- flowfile_core/routes/logs.py +21 -29
- flowfile_core/routes/public.py +3 -3
- flowfile_core/routes/routes.py +77 -43
- flowfile_core/routes/secrets.py +25 -27
- flowfile_core/routes/user_defined_components.py +483 -4
- flowfile_core/run_lock.py +0 -1
- flowfile_core/schemas/__init__.py +4 -6
- flowfile_core/schemas/analysis_schemas/graphic_walker_schemas.py +55 -55
- flowfile_core/schemas/cloud_storage_schemas.py +59 -55
- flowfile_core/schemas/input_schema.py +398 -154
- flowfile_core/schemas/output_model.py +50 -35
- flowfile_core/schemas/schemas.py +207 -67
- flowfile_core/schemas/transform_schema.py +1360 -435
- flowfile_core/schemas/yaml_types.py +117 -0
- flowfile_core/secret_manager/secret_manager.py +17 -13
- flowfile_core/{flowfile/node_designer/data_types.py → types.py} +33 -3
- flowfile_core/utils/arrow_reader.py +7 -6
- flowfile_core/utils/excel_file_manager.py +3 -3
- flowfile_core/utils/fileManager.py +7 -7
- flowfile_core/utils/fl_executor.py +8 -10
- flowfile_core/utils/utils.py +4 -4
- flowfile_core/utils/validate_setup.py +5 -4
- flowfile_frame/__init__.py +107 -50
- flowfile_frame/adapters.py +2 -9
- flowfile_frame/adding_expr.py +73 -32
- flowfile_frame/cloud_storage/frame_helpers.py +27 -23
- flowfile_frame/cloud_storage/secret_manager.py +12 -26
- flowfile_frame/config.py +2 -5
- flowfile_frame/expr.py +311 -218
- flowfile_frame/expr.pyi +160 -159
- flowfile_frame/expr_name.py +23 -23
- flowfile_frame/flow_frame.py +581 -489
- flowfile_frame/flow_frame.pyi +123 -104
- flowfile_frame/flow_frame_methods.py +236 -252
- flowfile_frame/group_frame.py +50 -20
- flowfile_frame/join.py +2 -2
- flowfile_frame/lazy.py +129 -87
- flowfile_frame/lazy_methods.py +83 -30
- flowfile_frame/list_name_space.py +55 -50
- flowfile_frame/selectors.py +148 -68
- flowfile_frame/series.py +9 -7
- flowfile_frame/utils.py +19 -21
- flowfile_worker/__init__.py +12 -4
- flowfile_worker/configs.py +11 -19
- flowfile_worker/create/__init__.py +14 -27
- flowfile_worker/create/funcs.py +143 -94
- flowfile_worker/create/models.py +139 -68
- flowfile_worker/create/pl_types.py +14 -15
- flowfile_worker/create/read_excel_tables.py +34 -41
- flowfile_worker/create/utils.py +22 -19
- flowfile_worker/external_sources/s3_source/main.py +18 -51
- flowfile_worker/external_sources/s3_source/models.py +34 -27
- flowfile_worker/external_sources/sql_source/main.py +8 -5
- flowfile_worker/external_sources/sql_source/models.py +13 -9
- flowfile_worker/flow_logger.py +10 -8
- flowfile_worker/funcs.py +214 -155
- flowfile_worker/main.py +11 -17
- flowfile_worker/models.py +35 -28
- flowfile_worker/process_manager.py +2 -3
- flowfile_worker/routes.py +121 -93
- flowfile_worker/secrets.py +9 -6
- flowfile_worker/spawner.py +80 -49
- flowfile_worker/utils.py +3 -2
- shared/__init__.py +2 -7
- shared/storage_config.py +25 -13
- test_utils/postgres/commands.py +3 -2
- test_utils/postgres/fixtures.py +9 -9
- test_utils/s3/commands.py +1 -1
- test_utils/s3/data_generator.py +3 -4
- test_utils/s3/demo_data_generator.py +4 -7
- test_utils/s3/fixtures.py +7 -5
- tools/migrate/README.md +56 -0
- tools/migrate/__init__.py +12 -0
- tools/migrate/__main__.py +118 -0
- tools/migrate/legacy_schemas.py +682 -0
- tools/migrate/migrate.py +610 -0
- tools/migrate/tests/__init__.py +0 -0
- tools/migrate/tests/conftest.py +21 -0
- tools/migrate/tests/test_migrate.py +622 -0
- tools/migrate/tests/test_migration_e2e.py +1009 -0
- tools/migrate/tests/test_node_migrations.py +843 -0
- flowfile/web/static/assets/CloudConnectionManager-2dfdce2f.css +0 -86
- flowfile/web/static/assets/CustomNode-74a37f74.css +0 -32
- flowfile/web/static/assets/DatabaseManager-30fa27e5.css +0 -64
- flowfile/web/static/assets/Filter-812dcbca.js +0 -164
- flowfile/web/static/assets/Filter-f62091b3.css +0 -20
- flowfile/web/static/assets/ManualInput-3246a08d.css +0 -96
- flowfile/web/static/assets/PivotValidation-891ddfb0.css +0 -13
- flowfile/web/static/assets/PivotValidation-c46cd420.css +0 -13
- flowfile/web/static/assets/SliderInput-b8fb6a8c.css +0 -4
- flowfile/web/static/assets/UnpivotValidation-0d240eeb.css +0 -13
- flowfile/web/static/assets/outputCsv-9cc59e0b.css +0 -2499
- flowfile/web/static/assets/outputParquet-cf8cf3f2.css +0 -4
- flowfile/web/static/assets/secretApi-538058f3.js +0 -46
- flowfile/web/static/assets/vue-codemirror-bccfde04.css +0 -32
- flowfile-0.4.1.dist-info/RECORD +0 -376
- flowfile_core/flowfile/manage/open_flowfile.py +0 -143
- {flowfile-0.4.1.dist-info → flowfile-0.5.3.dist-info}/licenses/LICENSE +0 -0
- /flowfile_core/flowfile/manage/manage_flowfile.py → /tools/__init__.py +0 -0
|
@@ -0,0 +1,1009 @@
|
|
|
1
|
+
"""
|
|
2
|
+
End-to-end tests for migration tool.
|
|
3
|
+
|
|
4
|
+
These tests verify that migrated flows can actually be loaded and executed
|
|
5
|
+
by the flowfile system - not just that the YAML/JSON structure is correct.
|
|
6
|
+
|
|
7
|
+
Run with:
|
|
8
|
+
pytest tools/migrate/tests/test_migration_e2e.py -v
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
import pickle
|
|
12
|
+
import tempfile
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
from typing import Literal
|
|
15
|
+
|
|
16
|
+
import pytest
|
|
17
|
+
|
|
18
|
+
from flowfile_core.flowfile.flow_graph import FlowGraph, add_connection
|
|
19
|
+
|
|
20
|
+
# Import actual flowfile system for verification
|
|
21
|
+
from flowfile_core.flowfile.handler import FlowfileHandler
|
|
22
|
+
from flowfile_core.flowfile.manage.io_flowfile import open_flow
|
|
23
|
+
from flowfile_core.schemas import input_schema, schemas, transform_schema
|
|
24
|
+
from flowfile_core.schemas.output_model import RunInformation
|
|
25
|
+
from tools.migrate.legacy_schemas import (
|
|
26
|
+
AggColl,
|
|
27
|
+
FieldInput,
|
|
28
|
+
FilterInput,
|
|
29
|
+
# Flow schemas
|
|
30
|
+
FlowInformation,
|
|
31
|
+
FlowSettings,
|
|
32
|
+
FunctionInput,
|
|
33
|
+
GroupByInput,
|
|
34
|
+
JoinInput,
|
|
35
|
+
JoinMap,
|
|
36
|
+
NodeFilter,
|
|
37
|
+
NodeFormula,
|
|
38
|
+
NodeGroupBy,
|
|
39
|
+
NodeInformation,
|
|
40
|
+
NodeJoin,
|
|
41
|
+
NodeSelect,
|
|
42
|
+
NodeSort,
|
|
43
|
+
SelectInput,
|
|
44
|
+
SortByInput,
|
|
45
|
+
)
|
|
46
|
+
from tools.migrate.migrate import migrate_flowfile
|
|
47
|
+
|
|
48
|
+
# =============================================================================
|
|
49
|
+
# HELPERS
|
|
50
|
+
# =============================================================================
|
|
51
|
+
|
|
52
|
+
def create_graph(flow_id: int = 1, execution_mode: Literal['Development', 'Performance'] = 'Development') -> FlowGraph:
|
|
53
|
+
"""Create a new FlowGraph for testing."""
|
|
54
|
+
handler = FlowfileHandler()
|
|
55
|
+
handler.register_flow(schemas.FlowSettings(
|
|
56
|
+
flow_id=flow_id,
|
|
57
|
+
name='test_flow',
|
|
58
|
+
path='.',
|
|
59
|
+
execution_mode=execution_mode
|
|
60
|
+
))
|
|
61
|
+
return handler.get_flow(flow_id)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def add_manual_input(graph: FlowGraph, data: list[dict], node_id: int = 1):
|
|
65
|
+
"""Add a manual input node with data."""
|
|
66
|
+
node_promise = input_schema.NodePromise(
|
|
67
|
+
flow_id=graph.flow_id,
|
|
68
|
+
node_id=node_id,
|
|
69
|
+
node_type='manual_input'
|
|
70
|
+
)
|
|
71
|
+
graph.add_node_promise(node_promise)
|
|
72
|
+
input_file = input_schema.NodeManualInput(
|
|
73
|
+
flow_id=graph.flow_id,
|
|
74
|
+
node_id=node_id,
|
|
75
|
+
raw_data_format=input_schema.RawData.from_pylist(data)
|
|
76
|
+
)
|
|
77
|
+
graph.add_manual_input(input_file)
|
|
78
|
+
return graph
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def add_node_promise(graph: FlowGraph, node_type: str, node_id: int):
|
|
82
|
+
"""Add a node promise."""
|
|
83
|
+
node_promise = input_schema.NodePromise(
|
|
84
|
+
flow_id=graph.flow_id,
|
|
85
|
+
node_id=node_id,
|
|
86
|
+
node_type=node_type
|
|
87
|
+
)
|
|
88
|
+
graph.add_node_promise(node_promise)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def handle_run_info(run_info: RunInformation):
|
|
92
|
+
"""Check run info for errors and raise if failed."""
|
|
93
|
+
if run_info is None:
|
|
94
|
+
raise ValueError("Run info is None")
|
|
95
|
+
if not run_info.success:
|
|
96
|
+
errors = 'errors:'
|
|
97
|
+
for node_step in run_info.node_step_result:
|
|
98
|
+
if not node_step.success:
|
|
99
|
+
errors += f'\n node_id:{node_step.node_id}, error: {node_step.error}'
|
|
100
|
+
raise ValueError(f'Graph should run successfully:\n{errors}')
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
# =============================================================================
|
|
104
|
+
# FIXTURES
|
|
105
|
+
# =============================================================================
|
|
106
|
+
|
|
107
|
+
@pytest.fixture
|
|
108
|
+
def temp_dir():
|
|
109
|
+
"""Create a temporary directory for test files."""
|
|
110
|
+
with tempfile.TemporaryDirectory() as tmpdir:
|
|
111
|
+
yield Path(tmpdir)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
@pytest.fixture
|
|
115
|
+
def sample_data() -> list[dict]:
|
|
116
|
+
"""Basic sample data for testing."""
|
|
117
|
+
return [
|
|
118
|
+
{'name': 'Alice', 'age': 30, 'city': 'NYC', 'sales': 100},
|
|
119
|
+
{'name': 'Bob', 'age': 25, 'city': 'LA', 'sales': 150},
|
|
120
|
+
{'name': 'Charlie', 'age': 35, 'city': 'NYC', 'sales': 200},
|
|
121
|
+
{'name': 'Diana', 'age': 28, 'city': 'Chicago', 'sales': 120},
|
|
122
|
+
]
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
# =============================================================================
|
|
126
|
+
# BASELINE TEST - Verify flowfile system works without migration
|
|
127
|
+
# =============================================================================
|
|
128
|
+
|
|
129
|
+
class TestFlowfileBaseline:
|
|
130
|
+
"""Verify the flowfile system works before testing migration."""
|
|
131
|
+
|
|
132
|
+
def test_manual_input_runs(self, sample_data):
|
|
133
|
+
"""Basic test that manual input works."""
|
|
134
|
+
graph = create_graph(flow_id=1)
|
|
135
|
+
add_manual_input(graph, sample_data, node_id=1)
|
|
136
|
+
|
|
137
|
+
run_info = graph.run_graph()
|
|
138
|
+
handle_run_info(run_info)
|
|
139
|
+
|
|
140
|
+
node = graph.get_node(1)
|
|
141
|
+
assert node is not None
|
|
142
|
+
|
|
143
|
+
def test_select_node_runs(self, sample_data):
|
|
144
|
+
"""Test select node works."""
|
|
145
|
+
graph = create_graph(flow_id=2)
|
|
146
|
+
add_manual_input(graph, sample_data, node_id=1)
|
|
147
|
+
|
|
148
|
+
add_node_promise(graph, 'select', node_id=2)
|
|
149
|
+
connection = input_schema.NodeConnection.create_from_simple_input(1, 2)
|
|
150
|
+
add_connection(graph, connection)
|
|
151
|
+
|
|
152
|
+
select_input = [
|
|
153
|
+
transform_schema.SelectInput(old_name='name', new_name='full_name', keep=True),
|
|
154
|
+
transform_schema.SelectInput(old_name='age', keep=True),
|
|
155
|
+
]
|
|
156
|
+
node_select = input_schema.NodeSelect(
|
|
157
|
+
flow_id=graph.flow_id,
|
|
158
|
+
node_id=2,
|
|
159
|
+
depending_on_id=1,
|
|
160
|
+
select_input=select_input,
|
|
161
|
+
)
|
|
162
|
+
graph.add_select(node_select)
|
|
163
|
+
|
|
164
|
+
run_info = graph.run_graph()
|
|
165
|
+
handle_run_info(run_info)
|
|
166
|
+
|
|
167
|
+
def test_filter_node_runs(self, sample_data):
|
|
168
|
+
"""Test filter node works."""
|
|
169
|
+
graph = create_graph(flow_id=3)
|
|
170
|
+
add_manual_input(graph, sample_data, node_id=1)
|
|
171
|
+
|
|
172
|
+
add_node_promise(graph, 'filter', node_id=2)
|
|
173
|
+
connection = input_schema.NodeConnection.create_from_simple_input(1, 2)
|
|
174
|
+
add_connection(graph, connection)
|
|
175
|
+
|
|
176
|
+
filter_input = transform_schema.FilterInput(
|
|
177
|
+
filter_type='advanced',
|
|
178
|
+
advanced_filter='[age] > 25'
|
|
179
|
+
)
|
|
180
|
+
node_filter = input_schema.NodeFilter(
|
|
181
|
+
flow_id=graph.flow_id,
|
|
182
|
+
node_id=2,
|
|
183
|
+
depending_on_id=1,
|
|
184
|
+
filter_input=filter_input,
|
|
185
|
+
)
|
|
186
|
+
graph.add_filter(node_filter)
|
|
187
|
+
|
|
188
|
+
run_info = graph.run_graph()
|
|
189
|
+
handle_run_info(run_info)
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
# =============================================================================
|
|
193
|
+
# YAML ROUND-TRIP TESTS - Save and reload flows (using NEW API)
|
|
194
|
+
# =============================================================================
|
|
195
|
+
|
|
196
|
+
class TestYamlRoundTrip:
|
|
197
|
+
"""Test that flows survive YAML save/load cycle."""
|
|
198
|
+
|
|
199
|
+
def test_select_roundtrip(self, temp_dir, sample_data):
|
|
200
|
+
"""Save and reload a flow with select node."""
|
|
201
|
+
graph = create_graph(flow_id=100)
|
|
202
|
+
add_manual_input(graph, sample_data, node_id=1)
|
|
203
|
+
|
|
204
|
+
add_node_promise(graph, 'select', node_id=2)
|
|
205
|
+
connection = input_schema.NodeConnection.create_from_simple_input(1, 2)
|
|
206
|
+
add_connection(graph, connection)
|
|
207
|
+
|
|
208
|
+
select_input = [
|
|
209
|
+
transform_schema.SelectInput(old_name='name', new_name='person_name'),
|
|
210
|
+
transform_schema.SelectInput(old_name='sales', keep=True),
|
|
211
|
+
]
|
|
212
|
+
node_select = input_schema.NodeSelect(
|
|
213
|
+
flow_id=graph.flow_id,
|
|
214
|
+
node_id=2,
|
|
215
|
+
depending_on_id=1,
|
|
216
|
+
select_input=select_input,
|
|
217
|
+
)
|
|
218
|
+
graph.add_select(node_select)
|
|
219
|
+
|
|
220
|
+
# Save as YAML
|
|
221
|
+
path = temp_dir / 'test.yaml'
|
|
222
|
+
graph.save_flow(str(path))
|
|
223
|
+
|
|
224
|
+
# Reload and run
|
|
225
|
+
loaded_flow = open_flow(path)
|
|
226
|
+
run_info = loaded_flow.run_graph()
|
|
227
|
+
handle_run_info(run_info)
|
|
228
|
+
|
|
229
|
+
# Verify node preserved
|
|
230
|
+
loaded_select = loaded_flow.get_node(2)
|
|
231
|
+
assert loaded_select is not None
|
|
232
|
+
assert loaded_select.setting_input.select_input[0].new_name == 'person_name'
|
|
233
|
+
|
|
234
|
+
def test_filter_roundtrip(self, temp_dir, sample_data):
|
|
235
|
+
"""Save and reload a flow with filter node."""
|
|
236
|
+
graph = create_graph(flow_id=101)
|
|
237
|
+
add_manual_input(graph, sample_data, node_id=1)
|
|
238
|
+
|
|
239
|
+
add_node_promise(graph, 'filter', node_id=2)
|
|
240
|
+
connection = input_schema.NodeConnection.create_from_simple_input(1, 2)
|
|
241
|
+
add_connection(graph, connection)
|
|
242
|
+
|
|
243
|
+
filter_input = transform_schema.FilterInput(
|
|
244
|
+
filter_type='basic',
|
|
245
|
+
basic_filter=transform_schema.BasicFilter(
|
|
246
|
+
field='age',
|
|
247
|
+
filter_type='>',
|
|
248
|
+
filter_value='25'
|
|
249
|
+
)
|
|
250
|
+
)
|
|
251
|
+
node_filter = input_schema.NodeFilter(
|
|
252
|
+
flow_id=graph.flow_id,
|
|
253
|
+
node_id=2,
|
|
254
|
+
depending_on_id=1,
|
|
255
|
+
filter_input=filter_input,
|
|
256
|
+
)
|
|
257
|
+
graph.add_filter(node_filter)
|
|
258
|
+
|
|
259
|
+
# Save and reload
|
|
260
|
+
path = temp_dir / 'test.yaml'
|
|
261
|
+
graph.save_flow(str(path))
|
|
262
|
+
loaded_flow = open_flow(path)
|
|
263
|
+
|
|
264
|
+
run_info = loaded_flow.run_graph()
|
|
265
|
+
handle_run_info(run_info)
|
|
266
|
+
|
|
267
|
+
def test_groupby_roundtrip(self, temp_dir, sample_data):
|
|
268
|
+
"""Save and reload a flow with groupby node."""
|
|
269
|
+
graph = create_graph(flow_id=102)
|
|
270
|
+
add_manual_input(graph, sample_data, node_id=1)
|
|
271
|
+
|
|
272
|
+
add_node_promise(graph, 'group_by', node_id=2)
|
|
273
|
+
connection = input_schema.NodeConnection.create_from_simple_input(1, 2)
|
|
274
|
+
add_connection(graph, connection)
|
|
275
|
+
|
|
276
|
+
groupby_input = transform_schema.GroupByInput([
|
|
277
|
+
transform_schema.AggColl('city', 'groupby'),
|
|
278
|
+
transform_schema.AggColl('sales', 'sum', 'total_sales'),
|
|
279
|
+
transform_schema.AggColl('age', 'mean', 'avg_age'),
|
|
280
|
+
])
|
|
281
|
+
node_groupby = input_schema.NodeGroupBy(
|
|
282
|
+
flow_id=graph.flow_id,
|
|
283
|
+
node_id=2,
|
|
284
|
+
depending_on_id=1,
|
|
285
|
+
groupby_input=groupby_input,
|
|
286
|
+
)
|
|
287
|
+
graph.add_group_by(node_groupby)
|
|
288
|
+
|
|
289
|
+
# Save and reload
|
|
290
|
+
path = temp_dir / 'test.yaml'
|
|
291
|
+
graph.save_flow(str(path))
|
|
292
|
+
loaded_flow = open_flow(path)
|
|
293
|
+
|
|
294
|
+
run_info = loaded_flow.run_graph()
|
|
295
|
+
handle_run_info(run_info)
|
|
296
|
+
|
|
297
|
+
# Verify aggregations preserved
|
|
298
|
+
loaded_gb = loaded_flow.get_node(2)
|
|
299
|
+
agg_cols = loaded_gb.setting_input.groupby_input.agg_cols
|
|
300
|
+
assert len(agg_cols) == 3
|
|
301
|
+
assert agg_cols[1].new_name == 'total_sales'
|
|
302
|
+
|
|
303
|
+
def test_join_roundtrip(self, temp_dir):
|
|
304
|
+
"""Save and reload a flow with join node (using NEW API with required selects)."""
|
|
305
|
+
graph = create_graph(flow_id=103)
|
|
306
|
+
|
|
307
|
+
# Left table
|
|
308
|
+
left_data = [
|
|
309
|
+
{'id': 1, 'name': 'Alice'},
|
|
310
|
+
{'id': 2, 'name': 'Bob'},
|
|
311
|
+
]
|
|
312
|
+
add_manual_input(graph, left_data, node_id=1)
|
|
313
|
+
|
|
314
|
+
# Right table
|
|
315
|
+
right_data = [
|
|
316
|
+
{'id': 1, 'dept': 'Sales'},
|
|
317
|
+
{'id': 2, 'dept': 'Engineering'},
|
|
318
|
+
]
|
|
319
|
+
add_node_promise(graph, 'manual_input', node_id=2)
|
|
320
|
+
input_file = input_schema.NodeManualInput(
|
|
321
|
+
flow_id=graph.flow_id,
|
|
322
|
+
node_id=2,
|
|
323
|
+
raw_data_format=input_schema.RawData.from_pylist(right_data)
|
|
324
|
+
)
|
|
325
|
+
graph.add_manual_input(input_file)
|
|
326
|
+
|
|
327
|
+
# Join node - NEW API requires left_select and right_select
|
|
328
|
+
add_node_promise(graph, 'join', node_id=3)
|
|
329
|
+
left_conn = input_schema.NodeConnection.create_from_simple_input(1, 3)
|
|
330
|
+
right_conn = input_schema.NodeConnection.create_from_simple_input(2, 3, input_type='right')
|
|
331
|
+
add_connection(graph, left_conn)
|
|
332
|
+
add_connection(graph, right_conn)
|
|
333
|
+
|
|
334
|
+
join_input = transform_schema.JoinInput(
|
|
335
|
+
join_mapping=[transform_schema.JoinMap(left_col='id', right_col='id')],
|
|
336
|
+
how='inner',
|
|
337
|
+
left_select=transform_schema.JoinInputs(renames=[]), # Required in new API
|
|
338
|
+
right_select=transform_schema.JoinInputs(renames=[]), # Required in new API
|
|
339
|
+
)
|
|
340
|
+
node_join = input_schema.NodeJoin(
|
|
341
|
+
flow_id=graph.flow_id,
|
|
342
|
+
node_id=3,
|
|
343
|
+
depending_on_ids=[1, 2],
|
|
344
|
+
join_input=join_input,
|
|
345
|
+
)
|
|
346
|
+
graph.add_join(node_join)
|
|
347
|
+
|
|
348
|
+
# Save and reload
|
|
349
|
+
path = temp_dir / 'test.yaml'
|
|
350
|
+
graph.save_flow(str(path))
|
|
351
|
+
loaded_flow = open_flow(path)
|
|
352
|
+
|
|
353
|
+
run_info = loaded_flow.run_graph()
|
|
354
|
+
handle_run_info(run_info)
|
|
355
|
+
|
|
356
|
+
def test_formula_roundtrip(self, temp_dir, sample_data):
|
|
357
|
+
"""Save and reload a flow with formula node."""
|
|
358
|
+
graph = create_graph(flow_id=104)
|
|
359
|
+
add_manual_input(graph, sample_data, node_id=1)
|
|
360
|
+
|
|
361
|
+
add_node_promise(graph, 'formula', node_id=2)
|
|
362
|
+
connection = input_schema.NodeConnection.create_from_simple_input(1, 2)
|
|
363
|
+
add_connection(graph, connection)
|
|
364
|
+
|
|
365
|
+
node_formula = input_schema.NodeFormula(
|
|
366
|
+
flow_id=graph.flow_id,
|
|
367
|
+
node_id=2,
|
|
368
|
+
depending_on_id=1,
|
|
369
|
+
function=transform_schema.FunctionInput(
|
|
370
|
+
field=transform_schema.FieldInput(name='double_sales'),
|
|
371
|
+
function='[sales] * 2'
|
|
372
|
+
)
|
|
373
|
+
)
|
|
374
|
+
graph.add_formula(node_formula)
|
|
375
|
+
|
|
376
|
+
# Save and reload
|
|
377
|
+
path = temp_dir / 'test.yaml'
|
|
378
|
+
graph.save_flow(str(path))
|
|
379
|
+
loaded_flow = open_flow(path)
|
|
380
|
+
|
|
381
|
+
run_info = loaded_flow.run_graph()
|
|
382
|
+
handle_run_info(run_info)
|
|
383
|
+
|
|
384
|
+
def test_sort_roundtrip(self, temp_dir, sample_data):
|
|
385
|
+
"""Save and reload a flow with sort node."""
|
|
386
|
+
graph = create_graph(flow_id=105)
|
|
387
|
+
add_manual_input(graph, sample_data, node_id=1)
|
|
388
|
+
|
|
389
|
+
add_node_promise(graph, 'sort', node_id=2)
|
|
390
|
+
connection = input_schema.NodeConnection.create_from_simple_input(1, 2)
|
|
391
|
+
add_connection(graph, connection)
|
|
392
|
+
|
|
393
|
+
node_sort = input_schema.NodeSort(
|
|
394
|
+
flow_id=graph.flow_id,
|
|
395
|
+
node_id=2,
|
|
396
|
+
depending_on_id=1,
|
|
397
|
+
sort_input=[
|
|
398
|
+
transform_schema.SortByInput(column='age', how='desc'),
|
|
399
|
+
transform_schema.SortByInput(column='name', how='asc'),
|
|
400
|
+
]
|
|
401
|
+
)
|
|
402
|
+
graph.add_sort(node_sort)
|
|
403
|
+
|
|
404
|
+
# Save and reload
|
|
405
|
+
path = temp_dir / 'test.yaml'
|
|
406
|
+
graph.save_flow(str(path))
|
|
407
|
+
loaded_flow = open_flow(path)
|
|
408
|
+
|
|
409
|
+
run_info = loaded_flow.run_graph()
|
|
410
|
+
handle_run_info(run_info)
|
|
411
|
+
|
|
412
|
+
def test_unique_roundtrip(self, temp_dir, sample_data):
|
|
413
|
+
"""Save and reload a flow with unique node."""
|
|
414
|
+
graph = create_graph(flow_id=106)
|
|
415
|
+
add_manual_input(graph, sample_data, node_id=1)
|
|
416
|
+
|
|
417
|
+
add_node_promise(graph, 'unique', node_id=2)
|
|
418
|
+
connection = input_schema.NodeConnection.create_from_simple_input(1, 2)
|
|
419
|
+
add_connection(graph, connection)
|
|
420
|
+
|
|
421
|
+
node_unique = input_schema.NodeUnique(
|
|
422
|
+
flow_id=graph.flow_id,
|
|
423
|
+
node_id=2,
|
|
424
|
+
depending_on_id=1,
|
|
425
|
+
unique_input=transform_schema.UniqueInput(
|
|
426
|
+
columns=['city'],
|
|
427
|
+
strategy='first'
|
|
428
|
+
)
|
|
429
|
+
)
|
|
430
|
+
graph.add_unique(node_unique)
|
|
431
|
+
|
|
432
|
+
# Save and reload
|
|
433
|
+
path = temp_dir / 'test.yaml'
|
|
434
|
+
graph.save_flow(str(path))
|
|
435
|
+
loaded_flow = open_flow(path)
|
|
436
|
+
|
|
437
|
+
run_info = loaded_flow.run_graph()
|
|
438
|
+
handle_run_info(run_info)
|
|
439
|
+
|
|
440
|
+
def test_record_id_roundtrip(self, temp_dir, sample_data):
|
|
441
|
+
"""Save and reload a flow with record_id node."""
|
|
442
|
+
graph = create_graph(flow_id=107)
|
|
443
|
+
add_manual_input(graph, sample_data, node_id=1)
|
|
444
|
+
|
|
445
|
+
add_node_promise(graph, 'record_id', node_id=2)
|
|
446
|
+
connection = input_schema.NodeConnection.create_from_simple_input(1, 2)
|
|
447
|
+
add_connection(graph, connection)
|
|
448
|
+
|
|
449
|
+
node_record_id = input_schema.NodeRecordId(
|
|
450
|
+
flow_id=graph.flow_id,
|
|
451
|
+
node_id=2,
|
|
452
|
+
depending_on_id=1,
|
|
453
|
+
record_id_input=transform_schema.RecordIdInput(
|
|
454
|
+
output_column_name='row_num',
|
|
455
|
+
offset=1
|
|
456
|
+
)
|
|
457
|
+
)
|
|
458
|
+
graph.add_record_id(node_record_id)
|
|
459
|
+
|
|
460
|
+
# Save and reload
|
|
461
|
+
path = temp_dir / 'test.yaml'
|
|
462
|
+
graph.save_flow(str(path))
|
|
463
|
+
loaded_flow = open_flow(path)
|
|
464
|
+
|
|
465
|
+
run_info = loaded_flow.run_graph()
|
|
466
|
+
handle_run_info(run_info)
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
# =============================================================================
|
|
470
|
+
# LEGACY MIGRATION TESTS - Test OLD pickle format → migrate → run
|
|
471
|
+
# =============================================================================
|
|
472
|
+
|
|
473
|
+
class TestLegacyMigration:
|
|
474
|
+
"""Test migration of OLD pickle format to new YAML format.
|
|
475
|
+
|
|
476
|
+
These tests:
|
|
477
|
+
1. Create flows using LEGACY schemas (simulating old .flowfile pickles)
|
|
478
|
+
2. Pickle them
|
|
479
|
+
3. Run migrate_flowfile()
|
|
480
|
+
4. Load with open_flow()
|
|
481
|
+
5. Add runtime data and verify execution
|
|
482
|
+
"""
|
|
483
|
+
|
|
484
|
+
def test_join_migration_with_none_selects(self, temp_dir):
|
|
485
|
+
"""Migrate old pickle with join node where left_select/right_select are None."""
|
|
486
|
+
# 1. Build legacy flow with OLD JoinInput (left_select=None, right_select=None)
|
|
487
|
+
legacy_join_input = JoinInput(
|
|
488
|
+
join_mapping=[JoinMap(left_col='id', right_col='id')],
|
|
489
|
+
how='inner',
|
|
490
|
+
left_select=None, # OLD: was allowed to be None
|
|
491
|
+
right_select=None, # OLD: was allowed to be None
|
|
492
|
+
)
|
|
493
|
+
|
|
494
|
+
legacy_flow = FlowInformation(
|
|
495
|
+
flow_id=103,
|
|
496
|
+
flow_name='join_migration_test',
|
|
497
|
+
flow_settings=FlowSettings(
|
|
498
|
+
flow_id=103,
|
|
499
|
+
name='join_migration_test',
|
|
500
|
+
path='.',
|
|
501
|
+
execution_mode='Development',
|
|
502
|
+
),
|
|
503
|
+
data={
|
|
504
|
+
1: NodeInformation(
|
|
505
|
+
id=1,
|
|
506
|
+
type='manual_input',
|
|
507
|
+
is_setup=True,
|
|
508
|
+
setting_input=None,
|
|
509
|
+
),
|
|
510
|
+
2: NodeInformation(
|
|
511
|
+
id=2,
|
|
512
|
+
type='manual_input',
|
|
513
|
+
is_setup=True,
|
|
514
|
+
setting_input=None,
|
|
515
|
+
),
|
|
516
|
+
3: NodeInformation(
|
|
517
|
+
id=3,
|
|
518
|
+
type='join',
|
|
519
|
+
is_setup=True,
|
|
520
|
+
left_input_id=1,
|
|
521
|
+
right_input_id=2,
|
|
522
|
+
setting_input=NodeJoin(
|
|
523
|
+
flow_id=103,
|
|
524
|
+
node_id=3,
|
|
525
|
+
depending_on_ids=[1, 2],
|
|
526
|
+
join_input=legacy_join_input,
|
|
527
|
+
),
|
|
528
|
+
),
|
|
529
|
+
},
|
|
530
|
+
node_connections=[(1, 3), (2, 3)],
|
|
531
|
+
node_starts=[1, 2],
|
|
532
|
+
)
|
|
533
|
+
|
|
534
|
+
# 2. Pickle it (simulating old .flowfile)
|
|
535
|
+
pickle_path = temp_dir / 'old_join.flowfile'
|
|
536
|
+
with open(pickle_path, 'wb') as f:
|
|
537
|
+
pickle.dump(legacy_flow, f)
|
|
538
|
+
|
|
539
|
+
# 3. Migrate to YAML
|
|
540
|
+
yaml_path = temp_dir / 'migrated.yaml'
|
|
541
|
+
migrate_flowfile(pickle_path, yaml_path, 'yaml')
|
|
542
|
+
|
|
543
|
+
# 4. Load with current system
|
|
544
|
+
loaded_flow = open_flow(yaml_path)
|
|
545
|
+
|
|
546
|
+
# 5. Add manual input data (not stored in pickle, added at runtime)
|
|
547
|
+
left_data = [{'id': 1, 'name': 'Alice'}, {'id': 2, 'name': 'Bob'}]
|
|
548
|
+
right_data = [{'id': 1, 'dept': 'Sales'}, {'id': 2, 'dept': 'Engineering'}]
|
|
549
|
+
|
|
550
|
+
loaded_flow.add_manual_input(input_schema.NodeManualInput(
|
|
551
|
+
flow_id=103, node_id=1,
|
|
552
|
+
raw_data_format=input_schema.RawData.from_pylist(left_data)
|
|
553
|
+
))
|
|
554
|
+
loaded_flow.add_manual_input(input_schema.NodeManualInput(
|
|
555
|
+
flow_id=103, node_id=2,
|
|
556
|
+
raw_data_format=input_schema.RawData.from_pylist(right_data)
|
|
557
|
+
))
|
|
558
|
+
|
|
559
|
+
# 6. Run and verify
|
|
560
|
+
run_info = loaded_flow.run_graph()
|
|
561
|
+
handle_run_info(run_info)
|
|
562
|
+
|
|
563
|
+
def test_filter_migration(self, temp_dir):
|
|
564
|
+
"""Migrate old pickle with filter node."""
|
|
565
|
+
legacy_filter = FilterInput(
|
|
566
|
+
filter_type='advanced',
|
|
567
|
+
advanced_filter='[age] > 25',
|
|
568
|
+
basic_filter=None,
|
|
569
|
+
)
|
|
570
|
+
|
|
571
|
+
legacy_flow = FlowInformation(
|
|
572
|
+
flow_id=201,
|
|
573
|
+
flow_name='filter_migration_test',
|
|
574
|
+
flow_settings=FlowSettings(
|
|
575
|
+
flow_id=201,
|
|
576
|
+
name='filter_migration_test',
|
|
577
|
+
path='.',
|
|
578
|
+
execution_mode='Development',
|
|
579
|
+
),
|
|
580
|
+
data={
|
|
581
|
+
1: NodeInformation(
|
|
582
|
+
id=1,
|
|
583
|
+
type='manual_input',
|
|
584
|
+
is_setup=True,
|
|
585
|
+
setting_input=None,
|
|
586
|
+
),
|
|
587
|
+
2: NodeInformation(
|
|
588
|
+
id=2,
|
|
589
|
+
type='filter',
|
|
590
|
+
is_setup=True,
|
|
591
|
+
setting_input=NodeFilter(
|
|
592
|
+
flow_id=201,
|
|
593
|
+
node_id=2,
|
|
594
|
+
depending_on_id=1,
|
|
595
|
+
filter_input=legacy_filter,
|
|
596
|
+
),
|
|
597
|
+
),
|
|
598
|
+
},
|
|
599
|
+
node_connections=[(1, 2)],
|
|
600
|
+
node_starts=[1],
|
|
601
|
+
)
|
|
602
|
+
|
|
603
|
+
# Pickle
|
|
604
|
+
pickle_path = temp_dir / 'old_filter.flowfile'
|
|
605
|
+
with open(pickle_path, 'wb') as f:
|
|
606
|
+
pickle.dump(legacy_flow, f)
|
|
607
|
+
|
|
608
|
+
# Migrate
|
|
609
|
+
yaml_path = temp_dir / 'migrated_filter.yaml'
|
|
610
|
+
migrate_flowfile(pickle_path, yaml_path, 'yaml')
|
|
611
|
+
|
|
612
|
+
# Load and add data
|
|
613
|
+
loaded_flow = open_flow(yaml_path)
|
|
614
|
+
data = [
|
|
615
|
+
{'name': 'Alice', 'age': 30},
|
|
616
|
+
{'name': 'Bob', 'age': 20},
|
|
617
|
+
{'name': 'Charlie', 'age': 35},
|
|
618
|
+
]
|
|
619
|
+
loaded_flow.add_manual_input(input_schema.NodeManualInput(
|
|
620
|
+
flow_id=201, node_id=1,
|
|
621
|
+
raw_data_format=input_schema.RawData.from_pylist(data)
|
|
622
|
+
))
|
|
623
|
+
|
|
624
|
+
# Run and verify
|
|
625
|
+
run_info = loaded_flow.run_graph()
|
|
626
|
+
handle_run_info(run_info)
|
|
627
|
+
|
|
628
|
+
def test_groupby_migration(self, temp_dir):
|
|
629
|
+
"""Migrate old pickle with groupby node."""
|
|
630
|
+
legacy_groupby = GroupByInput(
|
|
631
|
+
agg_cols=[
|
|
632
|
+
AggColl(old_name='city', agg='groupby'),
|
|
633
|
+
AggColl(old_name='sales', agg='sum', new_name='total_sales'),
|
|
634
|
+
]
|
|
635
|
+
)
|
|
636
|
+
|
|
637
|
+
legacy_flow = FlowInformation(
|
|
638
|
+
flow_id=202,
|
|
639
|
+
flow_name='groupby_migration_test',
|
|
640
|
+
flow_settings=FlowSettings(
|
|
641
|
+
flow_id=202,
|
|
642
|
+
name='groupby_migration_test',
|
|
643
|
+
path='.',
|
|
644
|
+
execution_mode='Development',
|
|
645
|
+
),
|
|
646
|
+
data={
|
|
647
|
+
1: NodeInformation(
|
|
648
|
+
id=1,
|
|
649
|
+
type='manual_input',
|
|
650
|
+
is_setup=True,
|
|
651
|
+
setting_input=None,
|
|
652
|
+
),
|
|
653
|
+
2: NodeInformation(
|
|
654
|
+
id=2,
|
|
655
|
+
type='group_by',
|
|
656
|
+
is_setup=True,
|
|
657
|
+
setting_input=NodeGroupBy(
|
|
658
|
+
flow_id=202,
|
|
659
|
+
node_id=2,
|
|
660
|
+
depending_on_id=1,
|
|
661
|
+
groupby_input=legacy_groupby,
|
|
662
|
+
),
|
|
663
|
+
),
|
|
664
|
+
},
|
|
665
|
+
node_connections=[(1, 2)],
|
|
666
|
+
node_starts=[1],
|
|
667
|
+
)
|
|
668
|
+
|
|
669
|
+
# Pickle
|
|
670
|
+
pickle_path = temp_dir / 'old_groupby.flowfile'
|
|
671
|
+
with open(pickle_path, 'wb') as f:
|
|
672
|
+
pickle.dump(legacy_flow, f)
|
|
673
|
+
|
|
674
|
+
# Migrate
|
|
675
|
+
yaml_path = temp_dir / 'migrated_groupby.yaml'
|
|
676
|
+
migrate_flowfile(pickle_path, yaml_path, 'yaml')
|
|
677
|
+
|
|
678
|
+
# Load and add data
|
|
679
|
+
loaded_flow = open_flow(yaml_path)
|
|
680
|
+
data = [
|
|
681
|
+
{'city': 'NYC', 'sales': 100},
|
|
682
|
+
{'city': 'NYC', 'sales': 150},
|
|
683
|
+
{'city': 'LA', 'sales': 200},
|
|
684
|
+
]
|
|
685
|
+
loaded_flow.add_manual_input(input_schema.NodeManualInput(
|
|
686
|
+
flow_id=202, node_id=1,
|
|
687
|
+
raw_data_format=input_schema.RawData.from_pylist(data)
|
|
688
|
+
))
|
|
689
|
+
|
|
690
|
+
# Run and verify
|
|
691
|
+
run_info = loaded_flow.run_graph()
|
|
692
|
+
handle_run_info(run_info)
|
|
693
|
+
|
|
694
|
+
def test_select_migration(self, temp_dir):
|
|
695
|
+
"""Migrate old pickle with select node."""
|
|
696
|
+
legacy_select_input = [
|
|
697
|
+
SelectInput(old_name='name', new_name='person_name', keep=True),
|
|
698
|
+
SelectInput(old_name='age', keep=True),
|
|
699
|
+
]
|
|
700
|
+
|
|
701
|
+
legacy_flow = FlowInformation(
|
|
702
|
+
flow_id=203,
|
|
703
|
+
flow_name='select_migration_test',
|
|
704
|
+
flow_settings=FlowSettings(
|
|
705
|
+
flow_id=203,
|
|
706
|
+
name='select_migration_test',
|
|
707
|
+
path='.',
|
|
708
|
+
execution_mode='Development',
|
|
709
|
+
),
|
|
710
|
+
data={
|
|
711
|
+
1: NodeInformation(
|
|
712
|
+
id=1,
|
|
713
|
+
type='manual_input',
|
|
714
|
+
is_setup=True,
|
|
715
|
+
setting_input=None,
|
|
716
|
+
),
|
|
717
|
+
2: NodeInformation(
|
|
718
|
+
id=2,
|
|
719
|
+
type='select',
|
|
720
|
+
is_setup=True,
|
|
721
|
+
setting_input=NodeSelect(
|
|
722
|
+
flow_id=203,
|
|
723
|
+
node_id=2,
|
|
724
|
+
depending_on_id=1,
|
|
725
|
+
select_input=legacy_select_input,
|
|
726
|
+
),
|
|
727
|
+
),
|
|
728
|
+
},
|
|
729
|
+
node_connections=[(1, 2)],
|
|
730
|
+
node_starts=[1],
|
|
731
|
+
)
|
|
732
|
+
|
|
733
|
+
# Pickle
|
|
734
|
+
pickle_path = temp_dir / 'old_select.flowfile'
|
|
735
|
+
with open(pickle_path, 'wb') as f:
|
|
736
|
+
pickle.dump(legacy_flow, f)
|
|
737
|
+
|
|
738
|
+
# Migrate
|
|
739
|
+
yaml_path = temp_dir / 'migrated_select.yaml'
|
|
740
|
+
migrate_flowfile(pickle_path, yaml_path, 'yaml')
|
|
741
|
+
|
|
742
|
+
# Load and add data
|
|
743
|
+
loaded_flow = open_flow(yaml_path)
|
|
744
|
+
data = [
|
|
745
|
+
{'name': 'Alice', 'age': 30, 'city': 'NYC'},
|
|
746
|
+
{'name': 'Bob', 'age': 25, 'city': 'LA'},
|
|
747
|
+
]
|
|
748
|
+
loaded_flow.add_manual_input(input_schema.NodeManualInput(
|
|
749
|
+
flow_id=203, node_id=1,
|
|
750
|
+
raw_data_format=input_schema.RawData.from_pylist(data)
|
|
751
|
+
))
|
|
752
|
+
|
|
753
|
+
# Run and verify
|
|
754
|
+
run_info = loaded_flow.run_graph()
|
|
755
|
+
handle_run_info(run_info)
|
|
756
|
+
|
|
757
|
+
def test_formula_migration(self, temp_dir):
|
|
758
|
+
"""Migrate old pickle with formula node."""
|
|
759
|
+
legacy_function = FunctionInput(
|
|
760
|
+
field=FieldInput(name='double_sales'),
|
|
761
|
+
function='[sales] * 2'
|
|
762
|
+
)
|
|
763
|
+
|
|
764
|
+
legacy_flow = FlowInformation(
|
|
765
|
+
flow_id=204,
|
|
766
|
+
flow_name='formula_migration_test',
|
|
767
|
+
flow_settings=FlowSettings(
|
|
768
|
+
flow_id=204,
|
|
769
|
+
name='formula_migration_test',
|
|
770
|
+
path='.',
|
|
771
|
+
execution_mode='Development',
|
|
772
|
+
),
|
|
773
|
+
data={
|
|
774
|
+
1: NodeInformation(
|
|
775
|
+
id=1,
|
|
776
|
+
type='manual_input',
|
|
777
|
+
is_setup=True,
|
|
778
|
+
setting_input=None,
|
|
779
|
+
),
|
|
780
|
+
2: NodeInformation(
|
|
781
|
+
id=2,
|
|
782
|
+
type='formula',
|
|
783
|
+
is_setup=True,
|
|
784
|
+
setting_input=NodeFormula(
|
|
785
|
+
flow_id=204,
|
|
786
|
+
node_id=2,
|
|
787
|
+
depending_on_id=1,
|
|
788
|
+
function=legacy_function,
|
|
789
|
+
),
|
|
790
|
+
),
|
|
791
|
+
},
|
|
792
|
+
node_connections=[(1, 2)],
|
|
793
|
+
node_starts=[1],
|
|
794
|
+
)
|
|
795
|
+
|
|
796
|
+
# Pickle
|
|
797
|
+
pickle_path = temp_dir / 'old_formula.flowfile'
|
|
798
|
+
with open(pickle_path, 'wb') as f:
|
|
799
|
+
pickle.dump(legacy_flow, f)
|
|
800
|
+
|
|
801
|
+
# Migrate
|
|
802
|
+
yaml_path = temp_dir / 'migrated_formula.yaml'
|
|
803
|
+
migrate_flowfile(pickle_path, yaml_path, 'yaml')
|
|
804
|
+
|
|
805
|
+
# Load and add data
|
|
806
|
+
loaded_flow = open_flow(yaml_path)
|
|
807
|
+
data = [
|
|
808
|
+
{'name': 'Alice', 'sales': 100},
|
|
809
|
+
{'name': 'Bob', 'sales': 150},
|
|
810
|
+
]
|
|
811
|
+
loaded_flow.add_manual_input(input_schema.NodeManualInput(
|
|
812
|
+
flow_id=204, node_id=1,
|
|
813
|
+
raw_data_format=input_schema.RawData.from_pylist(data)
|
|
814
|
+
))
|
|
815
|
+
|
|
816
|
+
# Run and verify
|
|
817
|
+
run_info = loaded_flow.run_graph()
|
|
818
|
+
handle_run_info(run_info)
|
|
819
|
+
|
|
820
|
+
def test_sort_migration(self, temp_dir):
|
|
821
|
+
"""Migrate old pickle with sort node."""
|
|
822
|
+
legacy_sort = [
|
|
823
|
+
SortByInput(column='age', how='desc'),
|
|
824
|
+
SortByInput(column='name', how='asc'),
|
|
825
|
+
]
|
|
826
|
+
|
|
827
|
+
legacy_flow = FlowInformation(
|
|
828
|
+
flow_id=205,
|
|
829
|
+
flow_name='sort_migration_test',
|
|
830
|
+
flow_settings=FlowSettings(
|
|
831
|
+
flow_id=205,
|
|
832
|
+
name='sort_migration_test',
|
|
833
|
+
path='.',
|
|
834
|
+
execution_mode='Development',
|
|
835
|
+
),
|
|
836
|
+
data={
|
|
837
|
+
1: NodeInformation(
|
|
838
|
+
id=1,
|
|
839
|
+
type='manual_input',
|
|
840
|
+
is_setup=True,
|
|
841
|
+
setting_input=None,
|
|
842
|
+
),
|
|
843
|
+
2: NodeInformation(
|
|
844
|
+
id=2,
|
|
845
|
+
type='sort',
|
|
846
|
+
is_setup=True,
|
|
847
|
+
setting_input=NodeSort(
|
|
848
|
+
flow_id=205,
|
|
849
|
+
node_id=2,
|
|
850
|
+
depending_on_id=1,
|
|
851
|
+
sort_input=legacy_sort,
|
|
852
|
+
),
|
|
853
|
+
),
|
|
854
|
+
},
|
|
855
|
+
node_connections=[(1, 2)],
|
|
856
|
+
node_starts=[1],
|
|
857
|
+
)
|
|
858
|
+
|
|
859
|
+
# Pickle
|
|
860
|
+
pickle_path = temp_dir / 'old_sort.flowfile'
|
|
861
|
+
with open(pickle_path, 'wb') as f:
|
|
862
|
+
pickle.dump(legacy_flow, f)
|
|
863
|
+
|
|
864
|
+
# Migrate
|
|
865
|
+
yaml_path = temp_dir / 'migrated_sort.yaml'
|
|
866
|
+
migrate_flowfile(pickle_path, yaml_path, 'yaml')
|
|
867
|
+
|
|
868
|
+
# Load and add data
|
|
869
|
+
loaded_flow = open_flow(yaml_path)
|
|
870
|
+
data = [
|
|
871
|
+
{'name': 'Alice', 'age': 30},
|
|
872
|
+
{'name': 'Bob', 'age': 25},
|
|
873
|
+
{'name': 'Charlie', 'age': 35},
|
|
874
|
+
]
|
|
875
|
+
loaded_flow.add_manual_input(input_schema.NodeManualInput(
|
|
876
|
+
flow_id=205, node_id=1,
|
|
877
|
+
raw_data_format=input_schema.RawData.from_pylist(data)
|
|
878
|
+
))
|
|
879
|
+
|
|
880
|
+
# Run and verify
|
|
881
|
+
run_info = loaded_flow.run_graph()
|
|
882
|
+
handle_run_info(run_info)
|
|
883
|
+
|
|
884
|
+
|
|
885
|
+
# =============================================================================
|
|
886
|
+
# COMPLEX PIPELINE TESTS
|
|
887
|
+
# =============================================================================
|
|
888
|
+
|
|
889
|
+
class TestComplexPipelines:
|
|
890
|
+
"""Test complex multi-node pipelines."""
|
|
891
|
+
|
|
892
|
+
def test_etl_pipeline(self, temp_dir):
|
|
893
|
+
"""Test a typical ETL pipeline: input -> filter -> formula -> groupby."""
|
|
894
|
+
graph = create_graph(flow_id=200)
|
|
895
|
+
|
|
896
|
+
data = [
|
|
897
|
+
{'region': 'East', 'product': 'A', 'sales': 100, 'active': True},
|
|
898
|
+
{'region': 'East', 'product': 'B', 'sales': 150, 'active': True},
|
|
899
|
+
{'region': 'West', 'product': 'A', 'sales': 200, 'active': False},
|
|
900
|
+
{'region': 'West', 'product': 'B', 'sales': 120, 'active': True},
|
|
901
|
+
{'region': 'East', 'product': 'A', 'sales': 80, 'active': True},
|
|
902
|
+
]
|
|
903
|
+
add_manual_input(graph, data, node_id=1)
|
|
904
|
+
|
|
905
|
+
# Filter: only active
|
|
906
|
+
add_node_promise(graph, 'filter', node_id=2)
|
|
907
|
+
add_connection(graph, input_schema.NodeConnection.create_from_simple_input(1, 2))
|
|
908
|
+
graph.add_filter(input_schema.NodeFilter(
|
|
909
|
+
flow_id=graph.flow_id,
|
|
910
|
+
node_id=2,
|
|
911
|
+
depending_on_id=1,
|
|
912
|
+
filter_input=transform_schema.FilterInput(
|
|
913
|
+
filter_type='advanced',
|
|
914
|
+
advanced_filter='[active] == true'
|
|
915
|
+
)
|
|
916
|
+
))
|
|
917
|
+
|
|
918
|
+
# Formula: double sales
|
|
919
|
+
add_node_promise(graph, 'formula', node_id=3)
|
|
920
|
+
add_connection(graph, input_schema.NodeConnection.create_from_simple_input(2, 3))
|
|
921
|
+
graph.add_formula(input_schema.NodeFormula(
|
|
922
|
+
flow_id=graph.flow_id,
|
|
923
|
+
node_id=3,
|
|
924
|
+
depending_on_id=2,
|
|
925
|
+
function=transform_schema.FunctionInput(
|
|
926
|
+
field=transform_schema.FieldInput(name='adjusted_sales'),
|
|
927
|
+
function='[sales] * 1.1'
|
|
928
|
+
)
|
|
929
|
+
))
|
|
930
|
+
|
|
931
|
+
# GroupBy: sum by region
|
|
932
|
+
add_node_promise(graph, 'group_by', node_id=4)
|
|
933
|
+
add_connection(graph, input_schema.NodeConnection.create_from_simple_input(3, 4))
|
|
934
|
+
graph.add_group_by(input_schema.NodeGroupBy(
|
|
935
|
+
flow_id=graph.flow_id,
|
|
936
|
+
node_id=4,
|
|
937
|
+
depending_on_id=3,
|
|
938
|
+
groupby_input=transform_schema.GroupByInput([
|
|
939
|
+
transform_schema.AggColl('region', 'groupby'),
|
|
940
|
+
transform_schema.AggColl('adjusted_sales', 'sum', 'total_adjusted'),
|
|
941
|
+
])
|
|
942
|
+
))
|
|
943
|
+
|
|
944
|
+
# Run original
|
|
945
|
+
run_info = graph.run_graph()
|
|
946
|
+
handle_run_info(run_info)
|
|
947
|
+
|
|
948
|
+
# Save and reload
|
|
949
|
+
path = temp_dir / 'etl_pipeline.yaml'
|
|
950
|
+
graph.save_flow(str(path))
|
|
951
|
+
loaded_flow = open_flow(path)
|
|
952
|
+
|
|
953
|
+
# Run reloaded
|
|
954
|
+
run_info = loaded_flow.run_graph()
|
|
955
|
+
handle_run_info(run_info)
|
|
956
|
+
|
|
957
|
+
# Verify all nodes present
|
|
958
|
+
assert loaded_flow.get_node(1) is not None
|
|
959
|
+
assert loaded_flow.get_node(2) is not None
|
|
960
|
+
assert loaded_flow.get_node(3) is not None
|
|
961
|
+
assert loaded_flow.get_node(4) is not None
|
|
962
|
+
|
|
963
|
+
|
|
964
|
+
# =============================================================================
|
|
965
|
+
# OUTPUT NODE TESTS
|
|
966
|
+
# =============================================================================
|
|
967
|
+
|
|
968
|
+
class TestOutputNode:
|
|
969
|
+
"""Test output node with different file types."""
|
|
970
|
+
|
|
971
|
+
def test_csv_output_roundtrip(self, temp_dir, sample_data):
|
|
972
|
+
"""Test CSV output node roundtrip."""
|
|
973
|
+
graph = create_graph(flow_id=300)
|
|
974
|
+
add_manual_input(graph, sample_data, node_id=1)
|
|
975
|
+
|
|
976
|
+
add_node_promise(graph, 'output', node_id=2)
|
|
977
|
+
add_connection(graph, input_schema.NodeConnection.create_from_simple_input(1, 2))
|
|
978
|
+
|
|
979
|
+
output_dir = temp_dir / 'output'
|
|
980
|
+
output_dir.mkdir()
|
|
981
|
+
|
|
982
|
+
graph.add_output(input_schema.NodeOutput(
|
|
983
|
+
flow_id=graph.flow_id,
|
|
984
|
+
node_id=2,
|
|
985
|
+
depending_on_id=1,
|
|
986
|
+
output_settings=input_schema.OutputSettings(
|
|
987
|
+
name='result.csv',
|
|
988
|
+
directory=str(output_dir),
|
|
989
|
+
file_type='csv',
|
|
990
|
+
write_mode='overwrite',
|
|
991
|
+
table_settings=input_schema.OutputCsvTable(
|
|
992
|
+
delimiter=';',
|
|
993
|
+
encoding='utf-8'
|
|
994
|
+
)
|
|
995
|
+
)
|
|
996
|
+
))
|
|
997
|
+
|
|
998
|
+
# Save and reload
|
|
999
|
+
path = temp_dir / 'test.yaml'
|
|
1000
|
+
graph.save_flow(str(path))
|
|
1001
|
+
loaded_flow = open_flow(path)
|
|
1002
|
+
|
|
1003
|
+
# Verify output settings preserved
|
|
1004
|
+
output_node = loaded_flow.get_node(2)
|
|
1005
|
+
assert output_node.setting_input.output_settings.table_settings.delimiter == ';'
|
|
1006
|
+
|
|
1007
|
+
|
|
1008
|
+
if __name__ == '__main__':
|
|
1009
|
+
pytest.main([__file__, '-v'])
|