fix(ingestion): Add aws_common dependency to cockroachdb and mariadb plugins #15189
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.
Fix: Add missing dependencies to cockroachdb, mariadb, and sql-queries connectors
Summary
This PR fixes missing dependencies for the
cockroachdb,mariadb, andsql-queriesconnectors, which were causing import errors when these connectors were installed.Root Cause
The issue was introduced by PR #14899 (
feat(ingest/postgres,mysql): Add iam auth support for MySql and Postgresql source), which added AWS RDS IAM authentication support to bothpostgres.pyandmysql.pysources. This change introduced imports fromdatahub.ingestion.source.aws.aws_common, which requiresboto3to be installed.Impact Chain
aws_common.py→ requiresboto3PostgresSource→ importspostgres.py→ transitively requiresboto3MySQLSource→ importsmysql.py→ transitively requiresboto3However, the dependency definitions in
setup.pywere not updated to includeaws_commonfor these derived connectors.Changes Made
1. Fixed
cockroachdbconnector dependenciessetup.py(line 461-464)aws_commonto dependenciessql_common | postgres_common | {"sqlalchemy-cockroachdb<2.0.0"}sql_common | postgres_common | aws_common | {"sqlalchemy-cockroachdb<2.0.0"}2. Fixed
mariadbconnector dependenciessetup.py(line 546)aws_commonto dependencies (fixing inconsistency with comment)sql_common | mysql(comment said "should have same dependency as mysql" but mysql hadaws_common)sql_common | mysql | aws_common3. Fixed
sql-queriesconnector dependenciessetup.py(line 574)aws_commonandsmart-open[s3]to dependenciesusage_common | sqlglot_libusage_common | sqlglot_lib | aws_common | {"smart-open[s3]>=5.2.1"}sql_queries.pydirectly importssmart_openfor S3 file access and importsAwsConnectionConfigfromaws_commonErrors Observed
Error 1: cockroachdb/mariadb
When installing
cockroachdbormariadbconnectors without this fix:Error 2: sql-queries
When installing
sql-queriesconnector without this fix:Testing
The fix ensures that when users install:
acryl-datahub[cockroachdb]→boto3is automatically installedacryl-datahub[mariadb]→boto3is automatically installedacryl-datahub[sql-queries]→boto3andsmart-open[s3]are automatically installedRelated PRs
feat(ingest/postgres,mysql): Add iam auth support for MySql and Postgresql sourceaws_common.pyto bothpostgres.pyandmysql.pyboto3dependency but only updated direct dependencies, not transitive onesVerification
Sources importing from postgres.py or mysql.py:
cockroachdb- fixed (imports frompostgres.py)mariadb- fixed (imports frommysql.py)Sources with direct imports requiring dependencies:
sql-queries- fixed (directly importssmart_openandaws_common)sql_queries.pyusessmart_openfor S3 file access (line 284)sql_queries.pyimportsAwsConnectionConfigfromaws_common(line 44)