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,843 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Tests for migration tool - verifies all node types migrate correctly.
|
|
3
|
+
|
|
4
|
+
Run with:
|
|
5
|
+
pytest tools/migrate/tests/test_node_migrations.py -v
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import json
|
|
9
|
+
import pickle
|
|
10
|
+
import tempfile
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
|
|
13
|
+
import pytest
|
|
14
|
+
|
|
15
|
+
from tools.migrate.legacy_schemas import (
|
|
16
|
+
AggColl,
|
|
17
|
+
BasicFilter,
|
|
18
|
+
CrossJoinInput,
|
|
19
|
+
FieldInput,
|
|
20
|
+
FilterInput,
|
|
21
|
+
# Flow schemas
|
|
22
|
+
FlowInformation,
|
|
23
|
+
FlowSettings,
|
|
24
|
+
FunctionInput,
|
|
25
|
+
FuzzyMapping,
|
|
26
|
+
FuzzyMatchInput,
|
|
27
|
+
GraphSolverInput,
|
|
28
|
+
GroupByInput,
|
|
29
|
+
JoinInput,
|
|
30
|
+
JoinInputs,
|
|
31
|
+
JoinMap,
|
|
32
|
+
NodeCrossJoin,
|
|
33
|
+
NodeFilter,
|
|
34
|
+
NodeFormula,
|
|
35
|
+
NodeFuzzyMatch,
|
|
36
|
+
NodeGraphSolver,
|
|
37
|
+
NodeGroupBy,
|
|
38
|
+
NodeInformation,
|
|
39
|
+
NodeJoin,
|
|
40
|
+
NodeOutput,
|
|
41
|
+
NodePivot,
|
|
42
|
+
NodePolarsCode,
|
|
43
|
+
# Node schemas
|
|
44
|
+
NodeRead,
|
|
45
|
+
NodeRecordId,
|
|
46
|
+
NodeSelect,
|
|
47
|
+
NodeSort,
|
|
48
|
+
NodeTextToRows,
|
|
49
|
+
NodeUnion,
|
|
50
|
+
NodeUnique,
|
|
51
|
+
NodeUnpivot,
|
|
52
|
+
OutputCsvTable,
|
|
53
|
+
OutputExcelTable,
|
|
54
|
+
OutputSettings,
|
|
55
|
+
PivotInput,
|
|
56
|
+
PolarsCodeInput,
|
|
57
|
+
# Input/Output schemas
|
|
58
|
+
ReceivedTable,
|
|
59
|
+
RecordIdInput,
|
|
60
|
+
# Transform schemas
|
|
61
|
+
SelectInput,
|
|
62
|
+
SortByInput,
|
|
63
|
+
TextToRowsInput,
|
|
64
|
+
UnionInput,
|
|
65
|
+
UniqueInput,
|
|
66
|
+
UnpivotInput,
|
|
67
|
+
)
|
|
68
|
+
from tools.migrate.migrate import migrate_flowfile
|
|
69
|
+
|
|
70
|
+
# =============================================================================
|
|
71
|
+
# FIXTURES
|
|
72
|
+
# =============================================================================
|
|
73
|
+
|
|
74
|
+
@pytest.fixture
|
|
75
|
+
def temp_dir():
|
|
76
|
+
with tempfile.TemporaryDirectory() as tmpdir:
|
|
77
|
+
yield Path(tmpdir)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def create_flow_with_node(node_type: str, node_setting) -> FlowInformation:
|
|
81
|
+
"""Helper to create a flow with a single node."""
|
|
82
|
+
return FlowInformation(
|
|
83
|
+
flow_id=1,
|
|
84
|
+
flow_name='test',
|
|
85
|
+
flow_settings=FlowSettings(flow_id=1, name='test'),
|
|
86
|
+
data={1: NodeInformation(id=1, type=node_type, setting_input=node_setting)},
|
|
87
|
+
node_starts=[1],
|
|
88
|
+
node_connections=[],
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def pickle_and_migrate(temp_dir: Path, flow: FlowInformation) -> dict:
|
|
93
|
+
"""Pickle a flow, migrate it, return JSON result."""
|
|
94
|
+
pickle_path = temp_dir / 'test.flowfile'
|
|
95
|
+
with open(pickle_path, 'wb') as f:
|
|
96
|
+
pickle.dump(flow, f)
|
|
97
|
+
|
|
98
|
+
output_path = migrate_flowfile(pickle_path, format='json')
|
|
99
|
+
|
|
100
|
+
with open(output_path) as f:
|
|
101
|
+
return json.load(f)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
# =============================================================================
|
|
105
|
+
# INPUT NODE TESTS
|
|
106
|
+
# =============================================================================
|
|
107
|
+
|
|
108
|
+
class TestReadNodeMigration:
|
|
109
|
+
"""Test NodeRead migrations with different file types."""
|
|
110
|
+
|
|
111
|
+
def test_csv_read_migration(self, temp_dir):
|
|
112
|
+
"""CSV read with custom settings."""
|
|
113
|
+
node = NodeRead(
|
|
114
|
+
flow_id=1, node_id=1,
|
|
115
|
+
received_file=ReceivedTable(
|
|
116
|
+
name='data.csv',
|
|
117
|
+
path='/data/data.csv',
|
|
118
|
+
file_type='csv',
|
|
119
|
+
delimiter=';',
|
|
120
|
+
encoding='latin-1',
|
|
121
|
+
has_headers=True,
|
|
122
|
+
starting_from_line=1,
|
|
123
|
+
infer_schema_length=5000,
|
|
124
|
+
quote_char="'",
|
|
125
|
+
truncate_ragged_lines=True,
|
|
126
|
+
ignore_errors=True,
|
|
127
|
+
)
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
data = pickle_and_migrate(temp_dir, create_flow_with_node('read', node))
|
|
131
|
+
|
|
132
|
+
rf = data['nodes'][0]['setting_input']['received_file']
|
|
133
|
+
assert rf['file_type'] == 'csv'
|
|
134
|
+
assert 'table_settings' in rf
|
|
135
|
+
assert rf['table_settings']['delimiter'] == ';'
|
|
136
|
+
assert rf['table_settings']['encoding'] == 'latin-1'
|
|
137
|
+
assert rf['table_settings']['starting_from_line'] == 1
|
|
138
|
+
|
|
139
|
+
def test_excel_read_migration(self, temp_dir):
|
|
140
|
+
"""Excel read with sheet and range settings."""
|
|
141
|
+
node = NodeRead(
|
|
142
|
+
flow_id=1, node_id=1,
|
|
143
|
+
received_file=ReceivedTable(
|
|
144
|
+
name='data.xlsx',
|
|
145
|
+
path='/data/data.xlsx',
|
|
146
|
+
file_type='excel',
|
|
147
|
+
sheet_name='Sales',
|
|
148
|
+
start_row=2,
|
|
149
|
+
start_column=1,
|
|
150
|
+
end_row=100,
|
|
151
|
+
end_column=10,
|
|
152
|
+
has_headers=True,
|
|
153
|
+
type_inference=True,
|
|
154
|
+
)
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
data = pickle_and_migrate(temp_dir, create_flow_with_node('read', node))
|
|
158
|
+
|
|
159
|
+
rf = data['nodes'][0]['setting_input']['received_file']
|
|
160
|
+
assert rf['file_type'] == 'excel'
|
|
161
|
+
assert rf['table_settings']['sheet_name'] == 'Sales'
|
|
162
|
+
assert rf['table_settings']['start_row'] == 2
|
|
163
|
+
assert rf['table_settings']['type_inference'] == True
|
|
164
|
+
|
|
165
|
+
def test_parquet_read_migration(self, temp_dir):
|
|
166
|
+
"""Parquet read."""
|
|
167
|
+
node = NodeRead(
|
|
168
|
+
flow_id=1, node_id=1,
|
|
169
|
+
received_file=ReceivedTable(
|
|
170
|
+
name='data.parquet',
|
|
171
|
+
path='/data/data.parquet',
|
|
172
|
+
file_type='parquet',
|
|
173
|
+
)
|
|
174
|
+
)
|
|
175
|
+
|
|
176
|
+
data = pickle_and_migrate(temp_dir, create_flow_with_node('read', node))
|
|
177
|
+
|
|
178
|
+
rf = data['nodes'][0]['setting_input']['received_file']
|
|
179
|
+
assert rf['file_type'] == 'parquet'
|
|
180
|
+
assert rf['table_settings']['file_type'] == 'parquet'
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
# =============================================================================
|
|
184
|
+
# OUTPUT NODE TESTS
|
|
185
|
+
# =============================================================================
|
|
186
|
+
|
|
187
|
+
class TestOutputNodeMigration:
|
|
188
|
+
"""Test NodeOutput migrations."""
|
|
189
|
+
|
|
190
|
+
def test_csv_output_migration(self, temp_dir):
|
|
191
|
+
"""CSV output with custom delimiter."""
|
|
192
|
+
node = NodeOutput(
|
|
193
|
+
flow_id=1, node_id=1,
|
|
194
|
+
output_settings=OutputSettings(
|
|
195
|
+
name='result.csv',
|
|
196
|
+
directory='/output',
|
|
197
|
+
file_type='csv',
|
|
198
|
+
write_mode='overwrite',
|
|
199
|
+
output_csv_table=OutputCsvTable(delimiter='|', encoding='utf-16'),
|
|
200
|
+
)
|
|
201
|
+
)
|
|
202
|
+
|
|
203
|
+
data = pickle_and_migrate(temp_dir, create_flow_with_node('output', node))
|
|
204
|
+
|
|
205
|
+
os = data['nodes'][0]['setting_input']['output_settings']
|
|
206
|
+
assert os['file_type'] == 'csv'
|
|
207
|
+
assert 'table_settings' in os
|
|
208
|
+
assert os['table_settings']['delimiter'] == '|'
|
|
209
|
+
assert os['table_settings']['encoding'] == 'utf-16'
|
|
210
|
+
# Old fields should be removed
|
|
211
|
+
assert 'output_csv_table' not in os
|
|
212
|
+
|
|
213
|
+
def test_excel_output_migration(self, temp_dir):
|
|
214
|
+
"""Excel output with sheet name."""
|
|
215
|
+
node = NodeOutput(
|
|
216
|
+
flow_id=1, node_id=1,
|
|
217
|
+
output_settings=OutputSettings(
|
|
218
|
+
name='result.xlsx',
|
|
219
|
+
directory='/output',
|
|
220
|
+
file_type='excel',
|
|
221
|
+
output_excel_table=OutputExcelTable(sheet_name='Results'),
|
|
222
|
+
)
|
|
223
|
+
)
|
|
224
|
+
|
|
225
|
+
data = pickle_and_migrate(temp_dir, create_flow_with_node('output', node))
|
|
226
|
+
|
|
227
|
+
os = data['nodes'][0]['setting_input']['output_settings']
|
|
228
|
+
assert os['file_type'] == 'excel'
|
|
229
|
+
assert os['table_settings']['sheet_name'] == 'Results'
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
# =============================================================================
|
|
233
|
+
# TRANSFORM NODE TESTS
|
|
234
|
+
# =============================================================================
|
|
235
|
+
|
|
236
|
+
class TestSelectNodeMigration:
|
|
237
|
+
"""Test NodeSelect migrations."""
|
|
238
|
+
|
|
239
|
+
def test_select_with_renames(self, temp_dir):
|
|
240
|
+
"""Select with column renames and drops."""
|
|
241
|
+
node = NodeSelect(
|
|
242
|
+
flow_id=1, node_id=1,
|
|
243
|
+
select_input=[
|
|
244
|
+
SelectInput(old_name='col_a', new_name='column_a', keep=True),
|
|
245
|
+
SelectInput(old_name='col_b', new_name='column_b', keep=True, data_type='String'),
|
|
246
|
+
SelectInput(old_name='col_c', keep=False),
|
|
247
|
+
],
|
|
248
|
+
sorted_by='asc',
|
|
249
|
+
keep_missing=True,
|
|
250
|
+
)
|
|
251
|
+
|
|
252
|
+
data = pickle_and_migrate(temp_dir, create_flow_with_node('select', node))
|
|
253
|
+
|
|
254
|
+
setting_input = data['nodes'][0]['setting_input']
|
|
255
|
+
assert 'select_input' in setting_input
|
|
256
|
+
assert len(setting_input['select_input']) == 3
|
|
257
|
+
assert setting_input['select_input'][0]['old_name'] == 'col_a'
|
|
258
|
+
assert setting_input['select_input'][0]['new_name'] == 'column_a'
|
|
259
|
+
|
|
260
|
+
def test_select_adds_position(self, temp_dir):
|
|
261
|
+
"""Verify positions are added to select inputs."""
|
|
262
|
+
node = NodeSelect(
|
|
263
|
+
flow_id=1, node_id=1,
|
|
264
|
+
select_input=[
|
|
265
|
+
SelectInput(old_name='a'),
|
|
266
|
+
SelectInput(old_name='b'),
|
|
267
|
+
]
|
|
268
|
+
)
|
|
269
|
+
|
|
270
|
+
data = pickle_and_migrate(temp_dir, create_flow_with_node('select', node))
|
|
271
|
+
|
|
272
|
+
inputs = data['nodes'][0]['setting_input']['select_input']
|
|
273
|
+
assert inputs[0].get('position') == 0
|
|
274
|
+
assert inputs[1].get('position') == 1
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
class TestFilterNodeMigration:
|
|
278
|
+
"""Test NodeFilter migrations."""
|
|
279
|
+
|
|
280
|
+
def test_basic_filter(self, temp_dir):
|
|
281
|
+
"""Basic filter with single condition."""
|
|
282
|
+
node = NodeFilter(
|
|
283
|
+
flow_id=1, node_id=1,
|
|
284
|
+
filter_input=FilterInput(
|
|
285
|
+
filter_type='basic',
|
|
286
|
+
basic_filter=BasicFilter(
|
|
287
|
+
field='amount',
|
|
288
|
+
filter_type='>',
|
|
289
|
+
filter_value='100'
|
|
290
|
+
)
|
|
291
|
+
)
|
|
292
|
+
)
|
|
293
|
+
|
|
294
|
+
data = pickle_and_migrate(temp_dir, create_flow_with_node('filter', node))
|
|
295
|
+
|
|
296
|
+
fi = data['nodes'][0]['setting_input']['filter_input']
|
|
297
|
+
assert fi['filter_type'] == 'basic'
|
|
298
|
+
assert fi['basic_filter']['field'] == 'amount'
|
|
299
|
+
assert fi['basic_filter']['filter_type'] == '>'
|
|
300
|
+
|
|
301
|
+
def test_advanced_filter(self, temp_dir):
|
|
302
|
+
"""Advanced filter with expression."""
|
|
303
|
+
node = NodeFilter(
|
|
304
|
+
flow_id=1, node_id=1,
|
|
305
|
+
filter_input=FilterInput(
|
|
306
|
+
filter_type='advanced',
|
|
307
|
+
advanced_filter='[amount] > 100 and [status] == "active"'
|
|
308
|
+
)
|
|
309
|
+
)
|
|
310
|
+
|
|
311
|
+
data = pickle_and_migrate(temp_dir, create_flow_with_node('filter', node))
|
|
312
|
+
|
|
313
|
+
fi = data['nodes'][0]['setting_input']['filter_input']
|
|
314
|
+
assert fi['filter_type'] == 'advanced'
|
|
315
|
+
assert '[amount] > 100' in fi['advanced_filter']
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
class TestFormulaNodeMigration:
|
|
319
|
+
"""Test NodeFormula migrations."""
|
|
320
|
+
|
|
321
|
+
def test_formula_with_expression(self, temp_dir):
|
|
322
|
+
"""Formula creating new column."""
|
|
323
|
+
node = NodeFormula(
|
|
324
|
+
flow_id=1, node_id=1,
|
|
325
|
+
function=FunctionInput(
|
|
326
|
+
field=FieldInput(name='total', data_type='Float64'),
|
|
327
|
+
function='[price] * [quantity]'
|
|
328
|
+
)
|
|
329
|
+
)
|
|
330
|
+
|
|
331
|
+
data = pickle_and_migrate(temp_dir, create_flow_with_node('formula', node))
|
|
332
|
+
|
|
333
|
+
func = data['nodes'][0]['setting_input']['function']
|
|
334
|
+
assert func['field']['name'] == 'total'
|
|
335
|
+
assert '[price] * [quantity]' in func['function']
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
class TestJoinNodeMigration:
|
|
339
|
+
"""Test NodeJoin migrations."""
|
|
340
|
+
|
|
341
|
+
def test_inner_join(self, temp_dir):
|
|
342
|
+
"""Inner join with single key."""
|
|
343
|
+
node = NodeJoin(
|
|
344
|
+
flow_id=1, node_id=1,
|
|
345
|
+
join_input=JoinInput(
|
|
346
|
+
join_mapping=[JoinMap(left_col='id', right_col='id')],
|
|
347
|
+
how='inner',
|
|
348
|
+
left_select=JoinInputs(renames=[SelectInput(old_name='id')]),
|
|
349
|
+
right_select=JoinInputs(renames=[SelectInput(old_name='value')]),
|
|
350
|
+
)
|
|
351
|
+
)
|
|
352
|
+
|
|
353
|
+
data = pickle_and_migrate(temp_dir, create_flow_with_node('join', node))
|
|
354
|
+
|
|
355
|
+
ji = data['nodes'][0]['setting_input']['join_input']
|
|
356
|
+
assert ji['how'] == 'inner'
|
|
357
|
+
assert ji['join_mapping'][0]['left_col'] == 'id'
|
|
358
|
+
assert ji['join_mapping'][0]['right_col'] == 'id'
|
|
359
|
+
|
|
360
|
+
def test_left_join_multi_key(self, temp_dir):
|
|
361
|
+
"""Left join with multiple keys."""
|
|
362
|
+
node = NodeJoin(
|
|
363
|
+
flow_id=1, node_id=1,
|
|
364
|
+
join_input=JoinInput(
|
|
365
|
+
join_mapping=[
|
|
366
|
+
JoinMap(left_col='date', right_col='date'),
|
|
367
|
+
JoinMap(left_col='product_id', right_col='prod_id'),
|
|
368
|
+
],
|
|
369
|
+
how='left',
|
|
370
|
+
left_select=JoinInputs(renames=[]),
|
|
371
|
+
right_select=JoinInputs(renames=[]),
|
|
372
|
+
)
|
|
373
|
+
)
|
|
374
|
+
|
|
375
|
+
data = pickle_and_migrate(temp_dir, create_flow_with_node('join', node))
|
|
376
|
+
|
|
377
|
+
ji = data['nodes'][0]['setting_input']['join_input']
|
|
378
|
+
assert ji['how'] == 'left'
|
|
379
|
+
assert len(ji['join_mapping']) == 2
|
|
380
|
+
assert ji['join_mapping'][1]['left_col'] == 'product_id'
|
|
381
|
+
assert ji['join_mapping'][1]['right_col'] == 'prod_id'
|
|
382
|
+
|
|
383
|
+
def test_join_with_none_selects(self, temp_dir):
|
|
384
|
+
"""Join with None left_select/right_select (old format) gets default empty renames."""
|
|
385
|
+
node = NodeJoin(
|
|
386
|
+
flow_id=1, node_id=1,
|
|
387
|
+
join_input=JoinInput(
|
|
388
|
+
join_mapping=[JoinMap(left_col='id', right_col='id')],
|
|
389
|
+
how='inner',
|
|
390
|
+
left_select=None,
|
|
391
|
+
right_select=None,
|
|
392
|
+
)
|
|
393
|
+
)
|
|
394
|
+
|
|
395
|
+
data = pickle_and_migrate(temp_dir, create_flow_with_node('join', node))
|
|
396
|
+
|
|
397
|
+
ji = data['nodes'][0]['setting_input']['join_input']
|
|
398
|
+
assert ji['left_select'] == {'renames': []}
|
|
399
|
+
assert ji['right_select'] == {'renames': []}
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
class TestCrossJoinNodeMigration:
|
|
403
|
+
"""Test NodeCrossJoin migrations."""
|
|
404
|
+
|
|
405
|
+
def test_cross_join(self, temp_dir):
|
|
406
|
+
"""Cross join with selects."""
|
|
407
|
+
node = NodeCrossJoin(
|
|
408
|
+
flow_id=1, node_id=1,
|
|
409
|
+
cross_join_input=CrossJoinInput(
|
|
410
|
+
left_select=JoinInputs(renames=[SelectInput(old_name='a')]),
|
|
411
|
+
right_select=JoinInputs(renames=[SelectInput(old_name='b')]),
|
|
412
|
+
)
|
|
413
|
+
)
|
|
414
|
+
|
|
415
|
+
data = pickle_and_migrate(temp_dir, create_flow_with_node('cross_join', node))
|
|
416
|
+
|
|
417
|
+
cji = data['nodes'][0]['setting_input']['cross_join_input']
|
|
418
|
+
assert 'left_select' in cji
|
|
419
|
+
assert 'right_select' in cji
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
class TestFuzzyMatchNodeMigration:
|
|
423
|
+
"""Test NodeFuzzyMatch migrations."""
|
|
424
|
+
|
|
425
|
+
def test_fuzzy_match(self, temp_dir):
|
|
426
|
+
"""Fuzzy match with threshold."""
|
|
427
|
+
node = NodeFuzzyMatch(
|
|
428
|
+
flow_id=1, node_id=1,
|
|
429
|
+
join_input=FuzzyMatchInput(
|
|
430
|
+
join_mapping=[
|
|
431
|
+
FuzzyMapping(
|
|
432
|
+
left_col='name',
|
|
433
|
+
right_col='company_name',
|
|
434
|
+
threshold_score=80,
|
|
435
|
+
fuzzy_type='levenshtein'
|
|
436
|
+
)
|
|
437
|
+
],
|
|
438
|
+
how='inner',
|
|
439
|
+
left_select=JoinInputs(renames=[]),
|
|
440
|
+
right_select=JoinInputs(renames=[]),
|
|
441
|
+
)
|
|
442
|
+
)
|
|
443
|
+
|
|
444
|
+
data = pickle_and_migrate(temp_dir, create_flow_with_node('fuzzy_match', node))
|
|
445
|
+
|
|
446
|
+
ji = data['nodes'][0]['setting_input']['join_input']
|
|
447
|
+
assert ji['join_mapping'][0]['threshold_score'] == 80
|
|
448
|
+
assert ji['join_mapping'][0]['fuzzy_type'] == 'levenshtein'
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
class TestGroupByNodeMigration:
|
|
452
|
+
"""Test NodeGroupBy migrations."""
|
|
453
|
+
|
|
454
|
+
def test_groupby_with_aggregations(self, temp_dir):
|
|
455
|
+
"""Group by with multiple aggregations."""
|
|
456
|
+
node = NodeGroupBy(
|
|
457
|
+
flow_id=1, node_id=1,
|
|
458
|
+
groupby_input=GroupByInput(
|
|
459
|
+
agg_cols=[
|
|
460
|
+
AggColl(old_name='category', agg='groupby'),
|
|
461
|
+
AggColl(old_name='amount', agg='sum', new_name='total_amount'),
|
|
462
|
+
AggColl(old_name='amount', agg='mean', new_name='avg_amount'),
|
|
463
|
+
AggColl(old_name='id', agg='count', new_name='record_count'),
|
|
464
|
+
]
|
|
465
|
+
)
|
|
466
|
+
)
|
|
467
|
+
|
|
468
|
+
data = pickle_and_migrate(temp_dir, create_flow_with_node('group_by', node))
|
|
469
|
+
|
|
470
|
+
agg_cols = data['nodes'][0]['setting_input']['groupby_input']['agg_cols']
|
|
471
|
+
assert len(agg_cols) == 4
|
|
472
|
+
assert agg_cols[0]['agg'] == 'groupby'
|
|
473
|
+
assert agg_cols[1]['new_name'] == 'total_amount'
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
class TestSortNodeMigration:
|
|
477
|
+
"""Test NodeSort migrations."""
|
|
478
|
+
|
|
479
|
+
def test_multi_column_sort(self, temp_dir):
|
|
480
|
+
"""Sort by multiple columns."""
|
|
481
|
+
node = NodeSort(
|
|
482
|
+
flow_id=1, node_id=1,
|
|
483
|
+
sort_input=[
|
|
484
|
+
SortByInput(column='date', how='desc'),
|
|
485
|
+
SortByInput(column='name', how='asc'),
|
|
486
|
+
]
|
|
487
|
+
)
|
|
488
|
+
|
|
489
|
+
data = pickle_and_migrate(temp_dir, create_flow_with_node('sort', node))
|
|
490
|
+
|
|
491
|
+
sort_input = data['nodes'][0]['setting_input']['sort_input']
|
|
492
|
+
assert len(sort_input) == 2
|
|
493
|
+
assert sort_input[0]['column'] == 'date'
|
|
494
|
+
assert sort_input[0]['how'] == 'desc'
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
class TestUnionNodeMigration:
|
|
498
|
+
"""Test NodeUnion migrations."""
|
|
499
|
+
|
|
500
|
+
def test_union_relaxed(self, temp_dir):
|
|
501
|
+
"""Union with relaxed mode."""
|
|
502
|
+
node = NodeUnion(
|
|
503
|
+
flow_id=1, node_id=1,
|
|
504
|
+
union_input=UnionInput(mode='relaxed')
|
|
505
|
+
)
|
|
506
|
+
|
|
507
|
+
data = pickle_and_migrate(temp_dir, create_flow_with_node('union', node))
|
|
508
|
+
|
|
509
|
+
assert data['nodes'][0]['setting_input']['union_input']['mode'] == 'relaxed'
|
|
510
|
+
|
|
511
|
+
def test_union_selective(self, temp_dir):
|
|
512
|
+
"""Union with selective mode."""
|
|
513
|
+
node = NodeUnion(
|
|
514
|
+
flow_id=1, node_id=1,
|
|
515
|
+
union_input=UnionInput(mode='selective')
|
|
516
|
+
)
|
|
517
|
+
|
|
518
|
+
data = pickle_and_migrate(temp_dir, create_flow_with_node('union', node))
|
|
519
|
+
|
|
520
|
+
assert data['nodes'][0]['setting_input']['union_input']['mode'] == 'selective'
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
class TestUniqueNodeMigration:
|
|
524
|
+
"""Test NodeUnique migrations."""
|
|
525
|
+
|
|
526
|
+
def test_unique_first_strategy(self, temp_dir):
|
|
527
|
+
"""Unique with first strategy."""
|
|
528
|
+
node = NodeUnique(
|
|
529
|
+
flow_id=1, node_id=1,
|
|
530
|
+
unique_input=UniqueInput(
|
|
531
|
+
columns=['id', 'date'],
|
|
532
|
+
strategy='first'
|
|
533
|
+
)
|
|
534
|
+
)
|
|
535
|
+
|
|
536
|
+
data = pickle_and_migrate(temp_dir, create_flow_with_node('unique', node))
|
|
537
|
+
|
|
538
|
+
ui = data['nodes'][0]['setting_input']['unique_input']
|
|
539
|
+
assert ui['columns'] == ['id', 'date']
|
|
540
|
+
assert ui['strategy'] == 'first'
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
class TestPivotNodeMigration:
|
|
544
|
+
"""Test NodePivot migrations."""
|
|
545
|
+
|
|
546
|
+
def test_pivot(self, temp_dir):
|
|
547
|
+
"""Pivot with aggregations."""
|
|
548
|
+
node = NodePivot(
|
|
549
|
+
flow_id=1, node_id=1,
|
|
550
|
+
pivot_input=PivotInput(
|
|
551
|
+
index_columns=['date'],
|
|
552
|
+
pivot_column='category',
|
|
553
|
+
value_col='amount',
|
|
554
|
+
aggregations=['sum', 'mean']
|
|
555
|
+
)
|
|
556
|
+
)
|
|
557
|
+
|
|
558
|
+
data = pickle_and_migrate(temp_dir, create_flow_with_node('pivot', node))
|
|
559
|
+
|
|
560
|
+
pi = data['nodes'][0]['setting_input']['pivot_input']
|
|
561
|
+
assert pi['index_columns'] == ['date']
|
|
562
|
+
assert pi['pivot_column'] == 'category'
|
|
563
|
+
assert 'sum' in pi['aggregations']
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
class TestUnpivotNodeMigration:
|
|
567
|
+
"""Test NodeUnpivot migrations."""
|
|
568
|
+
|
|
569
|
+
def test_unpivot(self, temp_dir):
|
|
570
|
+
"""Unpivot with column selection."""
|
|
571
|
+
node = NodeUnpivot(
|
|
572
|
+
flow_id=1, node_id=1,
|
|
573
|
+
unpivot_input=UnpivotInput(
|
|
574
|
+
index_columns=['id', 'date'],
|
|
575
|
+
value_columns=['jan', 'feb', 'mar'],
|
|
576
|
+
data_type_selector_mode='column'
|
|
577
|
+
)
|
|
578
|
+
)
|
|
579
|
+
|
|
580
|
+
data = pickle_and_migrate(temp_dir, create_flow_with_node('unpivot', node))
|
|
581
|
+
|
|
582
|
+
ui = data['nodes'][0]['setting_input']['unpivot_input']
|
|
583
|
+
assert ui['index_columns'] == ['id', 'date']
|
|
584
|
+
assert ui['value_columns'] == ['jan', 'feb', 'mar']
|
|
585
|
+
|
|
586
|
+
|
|
587
|
+
class TestRecordIdNodeMigration:
|
|
588
|
+
"""Test NodeRecordId migrations."""
|
|
589
|
+
|
|
590
|
+
def test_record_id(self, temp_dir):
|
|
591
|
+
"""Record ID with offset."""
|
|
592
|
+
node = NodeRecordId(
|
|
593
|
+
flow_id=1, node_id=1,
|
|
594
|
+
record_id_input=RecordIdInput(
|
|
595
|
+
output_column_name='row_number',
|
|
596
|
+
offset=1,
|
|
597
|
+
group_by=True,
|
|
598
|
+
group_by_columns=['category']
|
|
599
|
+
)
|
|
600
|
+
)
|
|
601
|
+
|
|
602
|
+
data = pickle_and_migrate(temp_dir, create_flow_with_node('record_id', node))
|
|
603
|
+
|
|
604
|
+
ri = data['nodes'][0]['setting_input']['record_id_input']
|
|
605
|
+
assert ri['output_column_name'] == 'row_number'
|
|
606
|
+
assert ri['offset'] == 1
|
|
607
|
+
assert ri['group_by'] == True
|
|
608
|
+
assert ri['group_by_columns'] == ['category']
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
class TestTextToRowsNodeMigration:
|
|
612
|
+
"""Test NodeTextToRows migrations."""
|
|
613
|
+
|
|
614
|
+
def test_text_to_rows(self, temp_dir):
|
|
615
|
+
"""Text to rows with delimiter."""
|
|
616
|
+
node = NodeTextToRows(
|
|
617
|
+
flow_id=1, node_id=1,
|
|
618
|
+
text_to_rows_input=TextToRowsInput(
|
|
619
|
+
column_to_split='tags',
|
|
620
|
+
output_column_name='tag',
|
|
621
|
+
split_by_fixed_value=True,
|
|
622
|
+
split_fixed_value=','
|
|
623
|
+
)
|
|
624
|
+
)
|
|
625
|
+
|
|
626
|
+
data = pickle_and_migrate(temp_dir, create_flow_with_node('text_to_rows', node))
|
|
627
|
+
|
|
628
|
+
ti = data['nodes'][0]['setting_input']['text_to_rows_input']
|
|
629
|
+
assert ti['column_to_split'] == 'tags'
|
|
630
|
+
assert ti['split_fixed_value'] == ','
|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
class TestGraphSolverNodeMigration:
|
|
634
|
+
"""Test NodeGraphSolver migrations."""
|
|
635
|
+
|
|
636
|
+
def test_graph_solver(self, temp_dir):
|
|
637
|
+
"""Graph solver for connected components."""
|
|
638
|
+
node = NodeGraphSolver(
|
|
639
|
+
flow_id=1, node_id=1,
|
|
640
|
+
graph_solver_input=GraphSolverInput(
|
|
641
|
+
col_from='source_id',
|
|
642
|
+
col_to='target_id',
|
|
643
|
+
output_column_name='component_id'
|
|
644
|
+
)
|
|
645
|
+
)
|
|
646
|
+
|
|
647
|
+
data = pickle_and_migrate(temp_dir, create_flow_with_node('graph_solver', node))
|
|
648
|
+
|
|
649
|
+
gi = data['nodes'][0]['setting_input']['graph_solver_input']
|
|
650
|
+
assert gi['col_from'] == 'source_id'
|
|
651
|
+
assert gi['col_to'] == 'target_id'
|
|
652
|
+
assert gi['output_column_name'] == 'component_id'
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
class TestPolarsCodeNodeMigration:
|
|
656
|
+
"""Test NodePolarsCode migrations."""
|
|
657
|
+
|
|
658
|
+
def test_polars_code(self, temp_dir):
|
|
659
|
+
"""Polars code with multi-line script."""
|
|
660
|
+
code = '''# Transform data
|
|
661
|
+
output_df = input_df.with_columns([
|
|
662
|
+
pl.col("amount") * 2,
|
|
663
|
+
pl.col("name").str.to_uppercase()
|
|
664
|
+
])
|
|
665
|
+
'''
|
|
666
|
+
node = NodePolarsCode(
|
|
667
|
+
flow_id=1, node_id=1,
|
|
668
|
+
polars_code_input=PolarsCodeInput(polars_code=code),
|
|
669
|
+
depending_on_ids=[0]
|
|
670
|
+
)
|
|
671
|
+
|
|
672
|
+
data = pickle_and_migrate(temp_dir, create_flow_with_node('polars_code', node))
|
|
673
|
+
|
|
674
|
+
pci = data['nodes'][0]['setting_input']['polars_code_input']
|
|
675
|
+
assert 'output_df' in pci['polars_code']
|
|
676
|
+
assert 'to_uppercase' in pci['polars_code']
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
# =============================================================================
|
|
680
|
+
# COMPLEX FLOW TESTS
|
|
681
|
+
# =============================================================================
|
|
682
|
+
|
|
683
|
+
class TestComplexFlowMigration:
|
|
684
|
+
"""Test migration of flows with multiple connected nodes."""
|
|
685
|
+
|
|
686
|
+
def test_pipeline_flow(self, temp_dir):
|
|
687
|
+
"""Test a complete pipeline: read -> select -> filter -> output."""
|
|
688
|
+
flow = FlowInformation(
|
|
689
|
+
flow_id=1,
|
|
690
|
+
flow_name='pipeline_flow',
|
|
691
|
+
flow_settings=FlowSettings(
|
|
692
|
+
flow_id=1,
|
|
693
|
+
name='pipeline_flow',
|
|
694
|
+
description='Test pipeline'
|
|
695
|
+
),
|
|
696
|
+
data={
|
|
697
|
+
1: NodeInformation(
|
|
698
|
+
id=1, type='read',
|
|
699
|
+
setting_input=NodeRead(
|
|
700
|
+
flow_id=1, node_id=1,
|
|
701
|
+
received_file=ReceivedTable(
|
|
702
|
+
name='input.csv', path='/data/input.csv',
|
|
703
|
+
file_type='csv', delimiter=','
|
|
704
|
+
)
|
|
705
|
+
)
|
|
706
|
+
),
|
|
707
|
+
2: NodeInformation(
|
|
708
|
+
id=2, type='select',
|
|
709
|
+
setting_input=NodeSelect(
|
|
710
|
+
flow_id=1, node_id=2,
|
|
711
|
+
select_input=[SelectInput(old_name='a', new_name='col_a')]
|
|
712
|
+
)
|
|
713
|
+
),
|
|
714
|
+
3: NodeInformation(
|
|
715
|
+
id=3, type='filter',
|
|
716
|
+
setting_input=NodeFilter(
|
|
717
|
+
flow_id=1, node_id=3,
|
|
718
|
+
filter_input=FilterInput(
|
|
719
|
+
filter_type='advanced',
|
|
720
|
+
advanced_filter='[col_a] > 0'
|
|
721
|
+
)
|
|
722
|
+
)
|
|
723
|
+
),
|
|
724
|
+
4: NodeInformation(
|
|
725
|
+
id=4, type='output',
|
|
726
|
+
setting_input=NodeOutput(
|
|
727
|
+
flow_id=1, node_id=4,
|
|
728
|
+
output_settings=OutputSettings(
|
|
729
|
+
name='output.csv', directory='/out',
|
|
730
|
+
file_type='csv',
|
|
731
|
+
output_csv_table=OutputCsvTable(delimiter=';')
|
|
732
|
+
)
|
|
733
|
+
)
|
|
734
|
+
),
|
|
735
|
+
},
|
|
736
|
+
node_starts=[1],
|
|
737
|
+
node_connections=[(1, 2), (2, 3), (3, 4)],
|
|
738
|
+
)
|
|
739
|
+
|
|
740
|
+
data = pickle_and_migrate(temp_dir, flow)
|
|
741
|
+
|
|
742
|
+
# Verify structure (FlowfileData format)
|
|
743
|
+
assert data['flowfile_name'] == 'pipeline_flow'
|
|
744
|
+
assert len(data['nodes']) == 4
|
|
745
|
+
|
|
746
|
+
# Verify each node migrated correctly
|
|
747
|
+
read_node = next(n for n in data['nodes'] if n['type'] == 'read')
|
|
748
|
+
assert 'table_settings' in read_node['setting_input']['received_file']
|
|
749
|
+
|
|
750
|
+
output_node = next(n for n in data['nodes'] if n['type'] == 'output')
|
|
751
|
+
assert 'table_settings' in output_node['setting_input']['output_settings']
|
|
752
|
+
assert output_node['setting_input']['output_settings']['table_settings']['delimiter'] == ';'
|
|
753
|
+
|
|
754
|
+
def test_join_flow(self, temp_dir):
|
|
755
|
+
"""Test flow with join: two inputs -> join -> output."""
|
|
756
|
+
flow = FlowInformation(
|
|
757
|
+
flow_id=1,
|
|
758
|
+
flow_name='join_flow',
|
|
759
|
+
flow_settings=FlowSettings(flow_id=1, name='join_flow'),
|
|
760
|
+
data={
|
|
761
|
+
1: NodeInformation(
|
|
762
|
+
id=1, type='read',
|
|
763
|
+
setting_input=NodeRead(
|
|
764
|
+
flow_id=1, node_id=1,
|
|
765
|
+
received_file=ReceivedTable(
|
|
766
|
+
name='left.csv', path='/data/left.csv', file_type='csv'
|
|
767
|
+
)
|
|
768
|
+
)
|
|
769
|
+
),
|
|
770
|
+
2: NodeInformation(
|
|
771
|
+
id=2, type='read',
|
|
772
|
+
setting_input=NodeRead(
|
|
773
|
+
flow_id=1, node_id=2,
|
|
774
|
+
received_file=ReceivedTable(
|
|
775
|
+
name='right.csv', path='/data/right.csv', file_type='csv'
|
|
776
|
+
)
|
|
777
|
+
)
|
|
778
|
+
),
|
|
779
|
+
3: NodeInformation(
|
|
780
|
+
id=3, type='join',
|
|
781
|
+
left_input_id=1, right_input_id=2,
|
|
782
|
+
setting_input=NodeJoin(
|
|
783
|
+
flow_id=1, node_id=3,
|
|
784
|
+
join_input=JoinInput(
|
|
785
|
+
join_mapping=[JoinMap(left_col='id', right_col='id')],
|
|
786
|
+
how='left',
|
|
787
|
+
left_select=None,
|
|
788
|
+
right_select=None,
|
|
789
|
+
)
|
|
790
|
+
)
|
|
791
|
+
),
|
|
792
|
+
},
|
|
793
|
+
node_starts=[1, 2],
|
|
794
|
+
node_connections=[(1, 3), (2, 3)],
|
|
795
|
+
)
|
|
796
|
+
|
|
797
|
+
data = pickle_and_migrate(temp_dir, flow)
|
|
798
|
+
|
|
799
|
+
assert len(data['nodes']) == 3
|
|
800
|
+
|
|
801
|
+
# Verify start nodes are marked
|
|
802
|
+
start_nodes = [n for n in data['nodes'] if n.get('is_start_node')]
|
|
803
|
+
assert len(start_nodes) == 2
|
|
804
|
+
|
|
805
|
+
join_node = next(n for n in data['nodes'] if n['type'] == 'join')
|
|
806
|
+
assert join_node['setting_input']['join_input']['how'] == 'left'
|
|
807
|
+
|
|
808
|
+
|
|
809
|
+
# =============================================================================
|
|
810
|
+
# YAML OUTPUT TESTS
|
|
811
|
+
# =============================================================================
|
|
812
|
+
|
|
813
|
+
class TestYamlMigration:
|
|
814
|
+
"""Test YAML format output."""
|
|
815
|
+
|
|
816
|
+
def test_yaml_format(self, temp_dir):
|
|
817
|
+
"""Verify YAML output is valid and readable."""
|
|
818
|
+
yaml = pytest.importorskip('yaml')
|
|
819
|
+
|
|
820
|
+
node = NodeSelect(
|
|
821
|
+
flow_id=1, node_id=1,
|
|
822
|
+
select_input=[SelectInput(old_name='test')]
|
|
823
|
+
)
|
|
824
|
+
|
|
825
|
+
flow = create_flow_with_node('select', node)
|
|
826
|
+
|
|
827
|
+
pickle_path = temp_dir / 'test.flowfile'
|
|
828
|
+
with open(pickle_path, 'wb') as f:
|
|
829
|
+
pickle.dump(flow, f)
|
|
830
|
+
|
|
831
|
+
output_path = migrate_flowfile(pickle_path, format='yaml')
|
|
832
|
+
|
|
833
|
+
with open(output_path) as f:
|
|
834
|
+
data = yaml.safe_load(f)
|
|
835
|
+
|
|
836
|
+
# Verify FlowfileData format
|
|
837
|
+
assert data['flowfile_version'] == '2.0'
|
|
838
|
+
assert data['flowfile_id'] == 1
|
|
839
|
+
assert len(data['nodes']) == 1
|
|
840
|
+
|
|
841
|
+
|
|
842
|
+
if __name__ == '__main__':
|
|
843
|
+
pytest.main([__file__, '-v'])
|