dbgraph 0.2.10__tar.gz → 0.2.11__tar.gz
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.
- {dbgraph-0.2.10 → dbgraph-0.2.11}/.idea/workspace.xml +84 -73
- {dbgraph-0.2.10 → dbgraph-0.2.11}/PKG-INFO +1 -1
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/builder/sql_graph_builder.py +26 -40
- {dbgraph-0.2.10 → dbgraph-0.2.11}/pyproject.toml +1 -1
- dbgraph-0.2.11/tests/idma.db +0 -0
- dbgraph-0.2.11/tests/integrates/test_idma_builder.py +38 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/uv.lock +3002 -3002
- {dbgraph-0.2.10 → dbgraph-0.2.11}/.gitignore +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/.idea/.gitignore +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/.idea/codeStyles/codeStyleConfig.xml +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/.idea/dbgraph.iml +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/.idea/inspectionProfiles/profiles_settings.xml +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/.idea/misc.xml +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/.idea/modules.xml +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/.idea/pydantic.xml +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/.idea/vcs.xml +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/.python-version +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/README.md +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/data/northwind-desc.md +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/data/northwind-graph-import.db +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/data/northwind-graph-v2.json +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/data/northwind-graph-v4.json +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/data/northwind-graph.db +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/data/northwind-graph.json +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/data/northwind-graph.png +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/data/northwind-index/corpus.jsonl +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/data/northwind-index/corpus.mmindex.json +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/data/northwind-index/data.csc.index.npy +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/data/northwind-index/indices.csc.index.npy +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/data/northwind-index/indptr.csc.index.npy +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/data/northwind-index/params.index.json +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/data/northwind-index/vocab.index.json +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/data/northwind-semantic-v5.json +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/data/northwind.db +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/data/time-results.txt +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/__init__.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/builder/__init__.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/builder/graph_builder.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/descriptor/__init__.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/descriptor/graph_descriptor.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/descriptor/langchain_graph_descriptor.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/descriptor/prompt_templates.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/entity/__init__.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/entity/aspect.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/entity/asset.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/entity/asset_type.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/entity/dbgraph.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/entity/link.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/entity/link_type.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/entity/rdbgraph.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/io/__init__.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/io/graph_loader.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/io/graph_writer.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/io/json_graph_loader.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/io/json_graph_writer.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/persistent/__init__.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/persistent/graph_not_found.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/persistent/graph_persistent.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/persistent/models/__init__.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/persistent/models/asset_aspect_orm.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/persistent/models/asset_orm.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/persistent/models/base.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/persistent/models/graph_orm.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/persistent/models/link_aspect_orm.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/persistent/models/link_orm.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/persistent/orm_graph_persistent.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/render/__init__.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/render/graph_renderer.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/render/markdown_renderer.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/search/__init__.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/search/bm25_search_engine.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/search/search_engine.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/utils/__init__.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/utils/logging.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/utils/serialize.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph/utils/singleton.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/dbgraph.log +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/diagrams/entity.png +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/diagrams/entity.txt +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/diagrams/usecase.png +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/diagrams/usecase.txt +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/docs/index.md +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/docs/refs/aspect.md +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/docs/refs/graph.md +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/main.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/mkdocs.yml +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/tests/__init__.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/tests/integrates/__init__.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/tests/integrates/test_json_graph_loader.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/tests/integrates/test_json_graph_writer.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/tests/integrates/test_langchain_graph_descriptor.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/tests/integrates/test_sql_graph_builder.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/tests/integrates/test_trino_builder.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/tests/units/__init__.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/tests/units/dbgraph.log +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/tests/units/test_dbgraph.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/tests/units/test_markdown_renderer.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/tests/units/test_orm_graph_persistent.py +0 -0
- {dbgraph-0.2.10 → dbgraph-0.2.11}/tests/units/test_rdbgraph.py +0 -0
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
<option name="autoReloadType" value="SELECTIVE" />
|
|
5
5
|
</component>
|
|
6
6
|
<component name="ChangeListManager">
|
|
7
|
-
<list default="true" id="263a96da-9a82-40fd-89b2-ba71dd2c194d" name="Changes" comment="update
|
|
7
|
+
<list default="true" id="263a96da-9a82-40fd-89b2-ba71dd2c194d" name="Changes" comment="update for sqlite">
|
|
8
|
+
<change afterPath="$PROJECT_DIR$/tests/integrates/test_idma_builder.py" afterDir="false" />
|
|
8
9
|
<change beforePath="$PROJECT_DIR$/.idea/dbgraph.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/dbgraph.iml" afterDir="false" />
|
|
9
|
-
<change beforePath="$PROJECT_DIR$/dbgraph/
|
|
10
|
-
<change beforePath="$PROJECT_DIR$/tests/units/test_orm_graph_persistent.py" beforeDir="false" afterPath="$PROJECT_DIR$/tests/units/test_orm_graph_persistent.py" afterDir="false" />
|
|
10
|
+
<change beforePath="$PROJECT_DIR$/dbgraph/builder/sql_graph_builder.py" beforeDir="false" afterPath="$PROJECT_DIR$/dbgraph/builder/sql_graph_builder.py" afterDir="false" />
|
|
11
11
|
<change beforePath="$PROJECT_DIR$/uv.lock" beforeDir="false" afterPath="$PROJECT_DIR$/uv.lock" afterDir="false" />
|
|
12
12
|
</list>
|
|
13
13
|
<option name="SHOW_DIALOG" value="false" />
|
|
@@ -68,68 +68,70 @@
|
|
|
68
68
|
<option name="hideEmptyMiddlePackages" value="true" />
|
|
69
69
|
<option name="showLibraryContents" value="true" />
|
|
70
70
|
</component>
|
|
71
|
-
<component name="PropertiesComponent"
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
71
|
+
<component name="PropertiesComponent">{
|
|
72
|
+
"keyToString": {
|
|
73
|
+
"ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
|
74
|
+
"ModuleVcsDetector.initialDetectionPerformed": "true",
|
|
75
|
+
"Python tests.Python tests for tests.integrates.test_idma_builder.TestIDMABuilder.test_builder.executor": "Run",
|
|
76
|
+
"Python tests.Python tests for tests.integrates.test_json_graph_loader.TestJSONGraphLoader.executor": "Run",
|
|
77
|
+
"Python tests.Python tests for tests.integrates.test_sql_graph_builder.TestSQLGraphBuilder.executor": "Run",
|
|
78
|
+
"Python tests.Python tests for tests.integrates.test_sql_graph_builder.TestSQLGraphBuilder.test_build_graph.executor": "Run",
|
|
79
|
+
"Python tests.Python tests for tests.integrates.test_trino_builder.TestTrinoBuilder.test__get_cat_stats_aspect.executor": "Run",
|
|
80
|
+
"Python tests.Python tests for tests.integrates.test_trino_builder.TestTrinoBuilder.test__get_columns.executor": "Run",
|
|
81
|
+
"Python tests.Python tests for tests.integrates.test_trino_builder.TestTrinoBuilder.test__get_columns_orm.executor": "Run",
|
|
82
|
+
"Python tests.Python tests for tests.integrates.test_trino_builder.TestTrinoBuilder.test__get_null_info.executor": "Run",
|
|
83
|
+
"Python tests.Python tests for tests.integrates.test_trino_builder.TestTrinoBuilder.test__get_numerical_stats_aspect.executor": "Run",
|
|
84
|
+
"Python tests.Python tests for tests.integrates.test_trino_builder.TestTrinoBuilder.test__get_table_orm.executor": "Run",
|
|
85
|
+
"Python tests.Python tests for tests.integrates.test_trino_builder.TestTrinoBuilder.test__get_table_row_count.executor": "Run",
|
|
86
|
+
"Python tests.Python tests for tests.integrates.test_trino_builder.TestTrinoBuilder.test__get_temp_aspect.executor": "Run",
|
|
87
|
+
"Python tests.Python tests for tests.integrates.test_trino_builder.TestTrinoBuilder.test__is_column_textual.executor": "Run",
|
|
88
|
+
"Python tests.Python tests for tests.integrates.test_trino_builder.TestTrinoBuilder.test_build_graph.executor": "Run",
|
|
89
|
+
"Python tests.Python tests for tests.integrates.test_trino_builder.TestTrinoBuilder.test_table_names.executor": "Run",
|
|
90
|
+
"Python tests.Python tests for tests.test_dbgraph.TestDBGraph.executor": "Run",
|
|
91
|
+
"Python tests.Python tests for tests.test_json_graph_loader.TestJSONGraphLoader.executor": "Run",
|
|
92
|
+
"Python tests.Python tests for tests.test_json_graph_loader.TestJSONGraphLoader.test_get_neighbors_sub_graph.executor": "Run",
|
|
93
|
+
"Python tests.Python tests for tests.test_load_graph_sql.TestLoadGraphSQL.test_load.executor": "Run",
|
|
94
|
+
"Python tests.Python tests for tests.test_markdown_renderer.TestMarkdownRenderer.executor": "Run",
|
|
95
|
+
"Python tests.Python tests for tests.test_orm_graph_persistent.TestORMGraphPersistent.executor": "Run",
|
|
96
|
+
"Python tests.Python tests for tests.test_orm_graph_persistent.TestORMGraphPersistent.test_cr_asset_aspect.executor": "Run",
|
|
97
|
+
"Python tests.Python tests for tests.test_orm_graph_persistent.TestORMGraphPersistent.test_cr_link_aspect.executor": "Run",
|
|
98
|
+
"Python tests.Python tests for tests.test_orm_graph_persistent.TestORMGraphPersistent.test_crud_assets.executor": "Run",
|
|
99
|
+
"Python tests.Python tests for tests.test_orm_graph_persistent.TestORMGraphPersistent.test_crud_links.executor": "Run",
|
|
100
|
+
"Python tests.Python tests for tests.test_orm_graph_persistent.TestORMGraphPersistent.test_insert_assets.executor": "Run",
|
|
101
|
+
"Python tests.Python tests for tests.test_orm_graph_persistent.TestORMGraphPersistent.test_insert_graph.executor": "Run",
|
|
102
|
+
"Python tests.Python tests for tests.test_orm_graph_persistent.TestORMGraphPersistent.test_insert_links.executor": "Run",
|
|
103
|
+
"Python tests.Python tests for tests.test_orm_graph_persistent.TestORMGraphPersistent.test_save_load_graph.executor": "Run",
|
|
104
|
+
"Python tests.Python tests for tests.test_rdbgraph.TestRDBGraph.executor": "Run",
|
|
105
|
+
"Python tests.Python tests for tests.test_sql_graph_builder.TestSQLGraphBuilder.executor": "Run",
|
|
106
|
+
"Python tests.Python tests for tests.test_sql_graph_builder.TestSQLGraphBuilder.test__build_links.executor": "Run",
|
|
107
|
+
"Python tests.Python tests for tests.test_sql_graph_builder.TestSQLGraphBuilder.test_build_graph.executor": "Run",
|
|
108
|
+
"Python tests.Python tests for tests.test_sql_graph_persistent.TestSQLGraphPersistent.executor": "Run",
|
|
109
|
+
"Python tests.Python tests for tests.test_sql_graph_persistent.TestSQLGraphPersistent.test_asset.executor": "Run",
|
|
110
|
+
"Python tests.Python tests for tests.test_sql_graph_persistent.TestSQLGraphPersistent.test_delete_graph.executor": "Run",
|
|
111
|
+
"Python tests.Python tests for tests.test_sql_graph_persistent.TestSQLGraphPersistent.test_link.executor": "Run",
|
|
112
|
+
"Python tests.Python tests for tests.test_sql_graph_persistent.TestSQLGraphPersistent.test_load_graph.executor": "Run",
|
|
113
|
+
"Python tests.Python tests for tests.test_sql_graph_persistent.TestSQLGraphPersistent.test_save_graph.executor": "Run",
|
|
114
|
+
"Python tests.Python tests for tests.units.test_dbgraph.TestDBGraph.executor": "Run",
|
|
115
|
+
"Python tests.Python tests for tests.units.test_orm_graph_persistent.TestORMGraphPersistent.test_save_load_graph.executor": "Run",
|
|
116
|
+
"Python tests.Python tests in test_load_graph_sql.py.executor": "Run",
|
|
117
|
+
"Python tests.Python tests in test_trino_builder.py.executor": "Run",
|
|
118
|
+
"Python tests.Python tests in tests.executor": "Run",
|
|
119
|
+
"Python tests.Python tests in units.executor": "Run",
|
|
120
|
+
"RunOnceActivity.ShowReadmeOnStart": "true",
|
|
121
|
+
"RunOnceActivity.git.unshallow": "true",
|
|
122
|
+
"RunOnceActivity.typescript.service.memoryLimit.init": "true",
|
|
123
|
+
"codeWithMe.voiceChat.enabledByDefault": "false",
|
|
124
|
+
"git-widget-placeholder": "optimize-queries",
|
|
125
|
+
"ignore.virus.scanning.warn.message": "true",
|
|
126
|
+
"node.js.detected.package.eslint": "true",
|
|
127
|
+
"node.js.detected.package.jshint": "true",
|
|
128
|
+
"node.js.selected.package.eslint": "(autodetect)",
|
|
129
|
+
"node.js.selected.package.jshint": "",
|
|
130
|
+
"nodejs_package_manager_path": "npm",
|
|
131
|
+
"run.code.analysis.last.selected.profile": "aDefault",
|
|
132
|
+
"settings.editor.selected.configurable": "preferences.PingConfigurable"
|
|
131
133
|
}
|
|
132
|
-
}
|
|
134
|
+
}</component>
|
|
133
135
|
<component name="PyConsoleOptionsProvider">
|
|
134
136
|
<option name="myPythonConsoleState">
|
|
135
137
|
<console-settings module-name="dbgraph" is-module-sdk="true">
|
|
@@ -144,8 +146,8 @@
|
|
|
144
146
|
<recent name="C:\Users\minhden\Projects\dbgraph\tests\units" />
|
|
145
147
|
</key>
|
|
146
148
|
</component>
|
|
147
|
-
<component name="RunManager" selected="Python tests.Python tests for tests.
|
|
148
|
-
<configuration name="Python tests for tests.integrates.
|
|
149
|
+
<component name="RunManager" selected="Python tests.Python tests for tests.integrates.test_idma_builder.TestIDMABuilder.test_builder">
|
|
150
|
+
<configuration name="Python tests for tests.integrates.test_idma_builder.TestIDMABuilder.test_builder" type="tests" factoryName="Autodetect" temporary="true" nameIsGenerated="true">
|
|
149
151
|
<module name="dbgraph" />
|
|
150
152
|
<option name="ENV_FILES" value="" />
|
|
151
153
|
<option name="INTERPRETER_OPTIONS" value="" />
|
|
@@ -158,7 +160,7 @@
|
|
|
158
160
|
<option name="DEBUG_JUST_MY_CODE" value="false" />
|
|
159
161
|
<option name="RUN_TOOL" value="" />
|
|
160
162
|
<option name="_new_additionalArguments" value="""" />
|
|
161
|
-
<option name="_new_target" value=""tests.integrates.
|
|
163
|
+
<option name="_new_target" value=""tests.integrates.test_idma_builder.TestIDMABuilder.test_builder"" />
|
|
162
164
|
<option name="_new_targetType" value=""PYTHON"" />
|
|
163
165
|
<method v="2" />
|
|
164
166
|
</configuration>
|
|
@@ -179,7 +181,7 @@
|
|
|
179
181
|
<option name="_new_targetType" value=""PYTHON"" />
|
|
180
182
|
<method v="2" />
|
|
181
183
|
</configuration>
|
|
182
|
-
<configuration name="Python tests for tests.
|
|
184
|
+
<configuration name="Python tests for tests.units.test_dbgraph.TestDBGraph" type="tests" factoryName="Autodetect" temporary="true" nameIsGenerated="true">
|
|
183
185
|
<module name="dbgraph" />
|
|
184
186
|
<option name="ENV_FILES" value="" />
|
|
185
187
|
<option name="INTERPRETER_OPTIONS" value="" />
|
|
@@ -192,7 +194,7 @@
|
|
|
192
194
|
<option name="DEBUG_JUST_MY_CODE" value="false" />
|
|
193
195
|
<option name="RUN_TOOL" value="" />
|
|
194
196
|
<option name="_new_additionalArguments" value="""" />
|
|
195
|
-
<option name="_new_target" value=""tests.
|
|
197
|
+
<option name="_new_target" value=""tests.units.test_dbgraph.TestDBGraph"" />
|
|
196
198
|
<option name="_new_targetType" value=""PYTHON"" />
|
|
197
199
|
<method v="2" />
|
|
198
200
|
</configuration>
|
|
@@ -232,11 +234,11 @@
|
|
|
232
234
|
</configuration>
|
|
233
235
|
<recent_temporary>
|
|
234
236
|
<list>
|
|
237
|
+
<item itemvalue="Python tests.Python tests for tests.integrates.test_idma_builder.TestIDMABuilder.test_builder" />
|
|
238
|
+
<item itemvalue="Python tests.Python tests for tests.units.test_dbgraph.TestDBGraph" />
|
|
235
239
|
<item itemvalue="Python tests.Python tests for tests.units.test_orm_graph_persistent.TestORMGraphPersistent.test_save_load_graph" />
|
|
236
240
|
<item itemvalue="Python tests.Python tests in units" />
|
|
237
241
|
<item itemvalue="Python tests.Python tests for tests.integrates.test_trino_builder.TestTrinoBuilder.test__get_table_orm" />
|
|
238
|
-
<item itemvalue="Python tests.Python tests for tests.integrates.test_sql_graph_builder.TestSQLGraphBuilder.test_build_graph" />
|
|
239
|
-
<item itemvalue="Python tests.Python tests for tests.integrates.test_trino_builder.TestTrinoBuilder.test__get_table_row_count" />
|
|
240
242
|
</list>
|
|
241
243
|
</recent_temporary>
|
|
242
244
|
</component>
|
|
@@ -351,7 +353,15 @@
|
|
|
351
353
|
<option name="project" value="LOCAL" />
|
|
352
354
|
<updated>1790219300115</updated>
|
|
353
355
|
</task>
|
|
354
|
-
<
|
|
356
|
+
<task id="LOCAL-00013" summary="update for sqlite">
|
|
357
|
+
<option name="closed" value="true" />
|
|
358
|
+
<created>1790220216196</created>
|
|
359
|
+
<option name="number" value="00013" />
|
|
360
|
+
<option name="presentableId" value="LOCAL-00013" />
|
|
361
|
+
<option name="project" value="LOCAL" />
|
|
362
|
+
<updated>1790220216196</updated>
|
|
363
|
+
</task>
|
|
364
|
+
<option name="localTasksCounter" value="14" />
|
|
355
365
|
<servers />
|
|
356
366
|
</component>
|
|
357
367
|
<component name="TypeScriptGeneratedFilesManager">
|
|
@@ -375,6 +385,7 @@
|
|
|
375
385
|
<MESSAGE value="remove events" />
|
|
376
386
|
<MESSAGE value="update renderer" />
|
|
377
387
|
<MESSAGE value="update sql builder and tests" />
|
|
378
|
-
<
|
|
388
|
+
<MESSAGE value="update for sqlite" />
|
|
389
|
+
<option name="LAST_COMMIT_MESSAGE" value="update for sqlite" />
|
|
379
390
|
</component>
|
|
380
391
|
</project>
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from concurrent.futures import ThreadPoolExecutor
|
|
3
2
|
from dataclasses import dataclass
|
|
4
|
-
from unittest import result
|
|
5
3
|
from uuid import uuid4
|
|
6
|
-
from tqdm import tqdm
|
|
7
4
|
|
|
8
5
|
from sqlalchemy import (
|
|
9
6
|
Column,
|
|
@@ -30,7 +27,7 @@ from sqlalchemy import (
|
|
|
30
27
|
DATE,
|
|
31
28
|
DATETIME,
|
|
32
29
|
distinct,
|
|
33
|
-
TIME, TIMESTAMP,
|
|
30
|
+
TIME, TIMESTAMP, VARBINARY,
|
|
34
31
|
)
|
|
35
32
|
from sqlalchemy.orm import Session
|
|
36
33
|
|
|
@@ -70,6 +67,7 @@ class SQLGraphBuilder(GraphBuilder):
|
|
|
70
67
|
detector_sample_size: int = 200
|
|
71
68
|
textual_length_threshold: int = 30
|
|
72
69
|
textual_distinct_ratio_threshold: float = 0.8
|
|
70
|
+
run_full_statistics: bool = True
|
|
73
71
|
|
|
74
72
|
def __post_init__(self):
|
|
75
73
|
logger.info("Creating SQLAlchemy engine...")
|
|
@@ -202,23 +200,26 @@ class SQLGraphBuilder(GraphBuilder):
|
|
|
202
200
|
if isinstance(
|
|
203
201
|
col.type, (Numeric, Integer, SmallInteger, BigInteger, Float, DECIMAL),
|
|
204
202
|
):
|
|
205
|
-
|
|
203
|
+
if self.run_full_statistics:
|
|
204
|
+
num_aspect = self._get_numerical_stats_aspect(col)
|
|
206
205
|
elif isinstance(col.type, (String, Text, Unicode, UnicodeText, CHAR, NCHAR)):
|
|
207
206
|
is_textual = self._is_column_textual(col)
|
|
208
207
|
if is_textual:
|
|
209
208
|
logger.debug("`%s` is textual type", col)
|
|
210
209
|
cat_aspect = None
|
|
211
210
|
else:
|
|
212
|
-
|
|
211
|
+
if self.run_full_statistics:
|
|
212
|
+
cat_aspect = self._get_cat_stats_aspect(col)
|
|
213
213
|
elif isinstance(col.type, (DATE, DATETIME, TIME, TIMESTAMP)):
|
|
214
|
-
|
|
215
|
-
|
|
214
|
+
if self.run_full_statistics:
|
|
215
|
+
temp_aspect = self._get_temp_aspect(col)
|
|
216
|
+
elif isinstance(col.type, (BLOB, VARBINARY)):
|
|
216
217
|
pass
|
|
217
218
|
else:
|
|
218
|
-
|
|
219
|
-
f"
|
|
220
|
-
|
|
221
|
-
|
|
219
|
+
logger.warning(f"Only support Numeric, String, Date, and BLOB. Got {col.type} for "
|
|
220
|
+
f"{col}")
|
|
221
|
+
pass
|
|
222
|
+
|
|
222
223
|
return RColumnStatisticsAspect(
|
|
223
224
|
name=f"{col.name}_column_stats",
|
|
224
225
|
numerical_stats=num_aspect,
|
|
@@ -231,21 +232,24 @@ class SQLGraphBuilder(GraphBuilder):
|
|
|
231
232
|
|
|
232
233
|
def _make_column_asset(self, col: Column, pks: PrimaryKeyConstraint) -> Asset:
|
|
233
234
|
logger.info("`%s` - building column asset...", col)
|
|
235
|
+
aspects = {}
|
|
234
236
|
schema_aspect = RColumnSchemaAspect(
|
|
235
237
|
name=f"{col.name}_column_schema",
|
|
236
238
|
dtype=str(col.type),
|
|
237
239
|
is_nullable=col.nullable or False,
|
|
238
240
|
is_pk=col.name in [c.name for c in pks.columns],
|
|
239
241
|
)
|
|
240
|
-
|
|
242
|
+
aspects["schema_properties"] = schema_aspect
|
|
243
|
+
|
|
244
|
+
if self.run_full_statistics:
|
|
245
|
+
stats_aspect = self._get_stats_aspect(col)
|
|
246
|
+
aspects["statistical_properties"] = stats_aspect
|
|
247
|
+
|
|
241
248
|
return Asset(
|
|
242
249
|
asset_id=uuid4(),
|
|
243
250
|
name=col.name,
|
|
244
251
|
type=AssetType.RCOLUMN,
|
|
245
|
-
aspects=
|
|
246
|
-
"schema_properties" : schema_aspect,
|
|
247
|
-
"statistical_properties": stats_aspect,
|
|
248
|
-
},
|
|
252
|
+
aspects=aspects,
|
|
249
253
|
)
|
|
250
254
|
|
|
251
255
|
def _get_columns_assets(self, table_name: str) -> list[Asset]:
|
|
@@ -255,25 +259,6 @@ class SQLGraphBuilder(GraphBuilder):
|
|
|
255
259
|
pks = table.primary_key
|
|
256
260
|
for column in table.columns:
|
|
257
261
|
assets.append(self._make_column_asset(column, pks))
|
|
258
|
-
# with ThreadPoolExecutor(max_workers=self.max_worker) as executor:
|
|
259
|
-
# if self.use_tqdm:
|
|
260
|
-
# assets = list(
|
|
261
|
-
# tqdm(
|
|
262
|
-
# executor.map(
|
|
263
|
-
# self._make_column_asset, table.columns,
|
|
264
|
-
# [pks] * len(table.columns),
|
|
265
|
-
# ),
|
|
266
|
-
# total=len(table.columns),
|
|
267
|
-
# desc="Processing columns",
|
|
268
|
-
# ),
|
|
269
|
-
# )
|
|
270
|
-
# else:
|
|
271
|
-
# assets = list(
|
|
272
|
-
# executor.map(
|
|
273
|
-
# self._make_column_asset, table.columns,
|
|
274
|
-
# [pks] * len(table.columns),
|
|
275
|
-
# ),
|
|
276
|
-
# )
|
|
277
262
|
return assets
|
|
278
263
|
|
|
279
264
|
def _get_table_stats_aspect(self, table_name: str) -> RTableStatisticsAspect:
|
|
@@ -314,16 +299,17 @@ class SQLGraphBuilder(GraphBuilder):
|
|
|
314
299
|
|
|
315
300
|
def _make_table_asset(self, table_name: str) -> Asset:
|
|
316
301
|
logger.info("`%s` - creating table asset...", table_name)
|
|
302
|
+
aspects = {}
|
|
303
|
+
|
|
317
304
|
stats_aspect = self._get_table_stats_aspect(table_name)
|
|
318
305
|
schema_aspect = self._get_table_schema_aspect(table_name)
|
|
306
|
+
aspects["schema_properties"] = schema_aspect
|
|
307
|
+
aspects["statistical_properties"] = stats_aspect
|
|
319
308
|
table_asset = Asset(
|
|
320
309
|
asset_id=uuid4(),
|
|
321
310
|
name=table_name,
|
|
322
311
|
type=AssetType.RTABLE,
|
|
323
|
-
aspects=
|
|
324
|
-
"schema_properties" : schema_aspect,
|
|
325
|
-
"statistical_properties": stats_aspect,
|
|
326
|
-
},
|
|
312
|
+
aspects=aspects,
|
|
327
313
|
)
|
|
328
314
|
self.columns_assets[table_asset.name] = self._get_columns_assets(table_name)
|
|
329
315
|
self.tables_assets[table_asset.name] = table_asset
|
|
Binary file
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
import unittest
|
|
3
|
+
from uuid import uuid4
|
|
4
|
+
|
|
5
|
+
from dbgraph import SQLGraphBuilder, ORMGraphPersistent
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class TestIDMABuilder(unittest.TestCase):
|
|
9
|
+
@classmethod
|
|
10
|
+
def setUpClass(cls) -> None:
|
|
11
|
+
|
|
12
|
+
logging.basicConfig(level=logging.DEBUG)
|
|
13
|
+
logging.getLogger("sqlalchemy").setLevel(
|
|
14
|
+
logging.WARNING,
|
|
15
|
+
) # ví dụ framework SQLAlchemy
|
|
16
|
+
logging.getLogger("urllib3").setLevel(logging.WARNING) # ví dụ requests/HTTP
|
|
17
|
+
logger = logging.getLogger("SQLGraphBuilder")
|
|
18
|
+
logger.propagate = False
|
|
19
|
+
|
|
20
|
+
def setUp(self) -> None:
|
|
21
|
+
self.uri = "trino://5e313dcb-78c7-4fe0-a399-83d6c55ed169:f4asulq4wluhis651wfi@67cc9102-3edf-44d7-98e8-59e824d365b4.idma.cloud:443/vnptiq_dev/genai_bronze"
|
|
22
|
+
self.builder = SQLGraphBuilder(
|
|
23
|
+
self.uri, run_full_statistics=False
|
|
24
|
+
)
|
|
25
|
+
persistent_uri = "sqlite:///tests/idma.db"
|
|
26
|
+
self.persistent = ORMGraphPersistent(persistent_uri)
|
|
27
|
+
|
|
28
|
+
def test_builder(self):
|
|
29
|
+
graph = self.builder.build_graph()
|
|
30
|
+
self.persistent.save_graph(
|
|
31
|
+
uuid4(),
|
|
32
|
+
"idma",
|
|
33
|
+
graph
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
if __name__ == "__main__":
|
|
38
|
+
unittest.main()
|