feat: Add a Gemini-powered dataset translation tool.#257
Open
feat: Add a Gemini-powered dataset translation tool.#257
Conversation
datasets/db-engine-convertor/src/db_convertor/importers/mysql_importer.py
Fixed
Show fixed
Hide fixed
datasets/db-engine-convertor/src/db_convertor/importers/spanner_importer.py
Fixed
Show fixed
Hide fixed
datasets/db-engine-convertor/src/db_convertor/importers/spanner_importer.py
Fixed
Show fixed
Hide fixed
datasets/db-engine-convertor/src/db_convertor/exporters/bigquery_exporter.py
Fixed
Show fixed
Hide fixed
datasets/db-engine-convertor/src/db_convertor/importers/bigquery_importer.py
Fixed
Show fixed
Hide fixed
datasets/db-engine-convertor/src/db_convertor/importers/bigquery_importer.py
Fixed
Show fixed
Hide fixed
datasets/db-engine-convertor/src/db_convertor/importers/bigquery_importer.py
Fixed
Show fixed
Hide fixed
datasets/db-engine-convertor/src/db_convertor/importers/mysql_importer.py
Fixed
Show fixed
Hide fixed
e4ac3a1 to
88e0232
Compare
It supports cross-engine translation, including schema mapping, data migration, and query conversion. All translations leverage LLM-generated artifacts paired with programmatic verification.
88e0232 to
aa3a564
Compare
Collaborator
|
Please take a look at the codeQ comments |
- Add super().__init__() call in MySQLImporter.__init__ - Fix file descriptor leak in silence_stderr() using sentinel values and outer finally block - Remove unnecessary pass statements in SpannerImporter - Remove unused imports (Optional, Any, GoogleAPICallError, time, shutil)
datasets/db-engine-convertor/src/db_convertor/converters/pg_to_bigquery.py
Fixed
Show fixed
Hide fixed
datasets/db-engine-convertor/src/db_convertor/query_converters/pg_to_mysql.py
Fixed
Show fixed
Hide fixed
datasets/db-engine-convertor/src/db_convertor/converters/pg_to_spanner.py
Fixed
Show fixed
Hide fixed
datasets/db-engine-convertor/src/db_convertor/importers/spanner_importer.py
Fixed
Show fixed
Hide fixed
datasets/db-engine-convertor/src/db_convertor/importers/spanner_importer.py
Fixed
Show fixed
Hide fixed
datasets/db-engine-convertor/src/db_convertor/importers/spanner_importer.py
Fixed
Show fixed
Hide fixed
- Remove unused Path import from pg_to_bigquery.py and pg_to_spanner.py - Remove unused ConversionStatus import from pg_to_mysql.py - Remove unused Path, List, Tuple imports from query_executor.py - Remove unused Dict, datetime imports from run_conversion_examples.py - Remove unused time, GoogleAPICallError, io imports from spanner_importer.py
- Remove unused ConversionStatus imports from sqlite_to_mysql.py and sqlite_to_pg.py - Remove unused Path import from sqlite_to_spanner.py - Remove unused collections import from agent.py - Remove duplicate google.auth import from spanner_importer.py - Remove unused local variables (attempt_history, rows_to_insert, result, fk_results) - Drop unused exception bindings (batch_exc, e) in except clauses
datasets/db-engine-convertor/src/db_convertor/query_converters/sqlite_to_mysql.py
Fixed
Show fixed
Hide fixed
datasets/db-engine-convertor/src/db_convertor/query_converters/sqlite_to_pg.py
Fixed
Show fixed
Hide fixed
datasets/db-engine-convertor/src/db_convertor/converters/sqlite_to_spanner.py
Fixed
Show fixed
Hide fixed
datasets/db-engine-convertor/src/db_convertor/importers/spanner_importer.py
Fixed
Show fixed
Hide fixed
datasets/db-engine-convertor/src/db_convertor/importers/spanner_importer.py
Fixed
Show fixed
Hide fixed
| finally: | ||
| try: | ||
| cursor.execute("SET FOREIGN_KEY_CHECKS=1") | ||
| except Exception: |
| cursor.execute(f"TRUNCATE TABLE `{table_name}`") | ||
| cursor.execute(f"SET FOREIGN_KEY_CHECKS=1") | ||
| conn.commit() | ||
| except Exception: |
| ) | ||
| # Query above is standard SQL, Spanner might differ slightly in IS structure. | ||
| # Fallback: simpler approach or try standard. | ||
| except Exception: |
| # Allow small floating point differences | ||
| if abs(src_num - dst_num) < 1e-6: | ||
| continue | ||
| except (ValueError, TypeError): |
| # For simplicity let's stick to strings for complex types and let client handle if possible, | ||
| # or add handling if we see errors. | ||
| return value | ||
| except: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It supports cross-engine translation, including schema mapping, data migration, and query conversion. All translations leverage LLM-generated artifacts paired with programmatic verification.