apache / iceberg-python

Apache PyIceberg
https://py.iceberg.apache.org/
Apache License 2.0
472 stars 173 forks source link

Preserve Backward compatibility in 0.8.0 for #1144 #1151

Closed sungwy closed 2 months ago

sungwy commented 2 months ago

In #1144, we moved 'public' classes and functions to submodules.

Although 'public' by naming convention, these classes and functions are meant for internal use. The current lack of explicit external API declarations makes it difficult to communicate with our end-users, which classes and functions we are intending to support for external use. (https://github.com/apache/iceberg-python/issues/1099)

The classes that were moved and are not referenced as an import in pyiceberg.table module are as follows:

UpdateTableMetadata is an abstract base class, and hence cannot be used directly.

This PR proposed to rename these as 'private' classes with single underscore prefix, and introduces functions that return these classes with a deprecation warning. This will allow users who are for some reason using these classes to see the warnings and update their code to not use these classes anymore.

Thanks @kevinjqliu for flagging this as a potential issue for backward compatibility.