You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "bsce20007 (via GitHub)" <gi...@apache.org> on 2025/01/14 19:46:10 UTC
[I] ImportError: cannot import name 'DeclarativeBase' from 'sqlalchemy.orm' [iceberg-python]
bsce20007 opened a new issue, #1514:
URL: https://github.com/apache/iceberg-python/issues/1514
### Apache Iceberg version
0.8.1 (latest release)
### Please describe the bug 🐞
I’m facing an issue where PyIceberg’s usage of SQLAlchemy 2.x is causing compatibility problems with Apache Airflow, which only supports SQLAlchemy 1.4.x. Specifically, I’m getting an ImportError: cannot import name 'DeclarativeBase' from 'sqlalchemy.orm' when running a DAG that uses PyIceberg. This issue occurs because PyIceberg expects SQLAlchemy 2.x, but I’m forced to use SQLAlchemy 1.4.x for compatibility with Airflow. Any advice on resolving this conflict or workarounds to make PyIceberg work with SQLAlchemy 1.4.x while maintaining Airflow functionality would be greatly appreciated.
### Willingness to contribute
- [ ] I can contribute a fix for this bug independently
- [x] I would be willing to contribute a fix for this bug with guidance from the Iceberg community
- [ ] I cannot contribute a fix for this bug at this time
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] ImportError: cannot import name 'DeclarativeBase' from 'sqlalchemy.orm' [iceberg-python]
Posted by "chespinoza (via GitHub)" <gi...@apache.org>.
chespinoza commented on issue #1514:
URL: https://github.com/apache/iceberg-python/issues/1514#issuecomment-2628934786
@bsce20007 If you are using pyiceberg in an Airflow pipeline, you should be able (it's a good practice) to isolate your dependencies using the correct setup for your operator. I've done this with the Python operator and Beam Operator, and of course, you also have the Docker operator.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] ImportError: cannot import name 'DeclarativeBase' from 'sqlalchemy.orm' [iceberg-python]
Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu commented on issue #1514:
URL: https://github.com/apache/iceberg-python/issues/1514#issuecomment-2593468214
> Airflow. Any advice on resolving this conflict or workarounds to make PyIceberg work with SQLAlchemy 1.4.x while maintaining Airflow functionality would be greatly appreciated.
I think you would either have to change Airflow or PyIceberg.
You might be able to change PyIceberg to use SQLAlchemy 1.x but I'm not sure if it'll be compatible. Historically, we have been using 2.x https://github.com/apache/iceberg-python/pulls?q=is%3Apr+SQLAlchemy+is%3Aclosed
Otherwise you might have to upgrade Airflow to align with PyIceberg
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] ImportError: cannot import name 'DeclarativeBase' from 'sqlalchemy.orm' [iceberg-python]
Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu closed issue #1514: ImportError: cannot import name 'DeclarativeBase' from 'sqlalchemy.orm'
URL: https://github.com/apache/iceberg-python/issues/1514
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org