Skip to content

Commit 4cf9198

Browse files
committed
Merge with main branch
2 parents e81907d + 44728c7 commit 4cf9198

35 files changed

+1162
-791
lines changed

.github/workflows/python-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
if: startsWith(matrix.os, 'ubuntu')
6464

6565
- name: Build wheels
66-
uses: pypa/[email protected].1
66+
uses: pypa/[email protected].3
6767
with:
6868
output-dir: wheelhouse
6969
config-file: "pyproject.toml"

mkdocs/docs/configuration.md

Lines changed: 46 additions & 36 deletions
Large diffs are not rendered by default.

mkdocs/docs/how-to-release.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ export LAST_COMMIT_ID=$(git rev-list ${GIT_TAG} 2> /dev/null | head -n 1)
8282
```
8383

8484
The `-s` option will sign the commit. If you don't have a key yet, you can find the instructions [here](http://www.apache.org/dev/openpgp.html#key-gen-generate-key). To install gpg on a M1 based Mac, a couple of additional steps are required: <https://gist.github.com/phortuin/cf24b1cca3258720c71ad42977e1ba57>.
85-
If you have not published your GPG key in [KEYS](https://dist.apache.org/repos/dist/dev/iceberg/KEYS) yet, you must publish it before sending the vote email by doing:
85+
If you have not published your GPG key in [KEYS](https://downloads.apache.org/iceberg/KEYS) yet, you must publish it before sending the vote email by doing:
8686

8787
```bash
88-
svn co https://dist.apache.org/repos/dist/dev/iceberg icebergsvn
88+
svn co https://dist.apache.org/repos/dist/release/iceberg icebergsvn
8989
cd icebergsvn
9090
echo "" >> KEYS # append a newline
9191
gpg --list-sigs <YOUR KEY ID HERE> >> KEYS # append signatures
@@ -166,7 +166,7 @@ The release tarball, signature, and checksums are here:
166166
167167
You can find the KEYS file here:
168168
169-
* https://dist.apache.org/repos/dist/dev/iceberg/KEYS
169+
* https://downloads.apache.org/iceberg/KEYS
170170
171171
Convenience binary artifacts are staged on pypi:
172172

mkdocs/docs/verify-release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ After downloading the source tarball, signature, checksum, and KEYS file, here a
4040
First, import the keys.
4141

4242
```sh
43-
curl https://dist.apache.org/repos/dist/dev/iceberg/KEYS -o KEYS
43+
curl https://downloads.apache.org/iceberg/KEYS -o KEYS
4444
gpg --import KEYS
4545
```
4646

mkdocs/requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
# under the License.
1717

1818
mkdocs==1.6.1
19-
griffe==1.3.1
19+
griffe==1.5.1
2020
jinja2==3.1.4
21-
mkdocstrings==0.26.1
22-
mkdocstrings-python==1.11.1
21+
mkdocstrings==0.26.2
22+
mkdocstrings-python==1.12.2
2323
mkdocs-literate-nav==0.6.1
2424
mkdocs-autorefs==1.2.0
2525
mkdocs-gen-files==0.5.0
26-
mkdocs-material==9.5.36
26+
mkdocs-material==9.5.43
2727
mkdocs-material-extensions==1.3.1
2828
mkdocs-section-index==0.3.9

poetry.lock

Lines changed: 496 additions & 443 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyiceberg/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
__version__ = "0.7.1"
18+
__version__ = "0.8.0"

pyiceberg/catalog/__init__.py

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -106,20 +106,7 @@
106106
re.X,
107107
)
108108

109-
DEPRECATED_PROFILE_NAME = "profile_name"
110-
DEPRECATED_REGION = "region_name"
111109
DEPRECATED_BOTOCORE_SESSION = "botocore_session"
112-
DEPRECATED_ACCESS_KEY_ID = "aws_access_key_id"
113-
DEPRECATED_SECRET_ACCESS_KEY = "aws_secret_access_key"
114-
DEPRECATED_SESSION_TOKEN = "aws_session_token"
115-
DEPRECATED_PROPERTY_NAMES = {
116-
DEPRECATED_PROFILE_NAME,
117-
DEPRECATED_REGION,
118-
DEPRECATED_BOTOCORE_SESSION,
119-
DEPRECATED_ACCESS_KEY_ID,
120-
DEPRECATED_SECRET_ACCESS_KEY,
121-
DEPRECATED_SESSION_TOKEN,
122-
}
123110

124111

125112
class CatalogType(Enum):
@@ -794,13 +781,12 @@ class MetastoreCatalog(Catalog, ABC):
794781
def __init__(self, name: str, **properties: str):
795782
super().__init__(name, **properties)
796783

797-
for property_name in DEPRECATED_PROPERTY_NAMES:
798-
if self.properties.get(property_name):
799-
deprecation_message(
800-
deprecated_in="0.7.0",
801-
removed_in="0.8.0",
802-
help_message=f"The property {property_name} is deprecated. Please use properties that start with client., glue., and dynamo. instead",
803-
)
784+
if self.properties.get(DEPRECATED_BOTOCORE_SESSION):
785+
deprecation_message(
786+
deprecated_in="0.8.0",
787+
removed_in="0.9.0",
788+
help_message=f"The property {DEPRECATED_BOTOCORE_SESSION} is deprecated and will be removed.",
789+
)
804790

805791
def create_table_transaction(
806792
self,
@@ -1011,4 +997,4 @@ def _empty_table_metadata() -> TableMetadata:
1011997
Returns:
1012998
TableMetadata: An empty TableMetadata instance.
1013999
"""
1014-
return TableMetadataV1(location="", last_column_id=-1, schema=Schema())
1000+
return TableMetadataV1.model_construct(last_column_id=-1, schema=Schema())

pyiceberg/catalog/dynamodb.py

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,7 @@
3030
import boto3
3131

3232
from pyiceberg.catalog import (
33-
DEPRECATED_ACCESS_KEY_ID,
3433
DEPRECATED_BOTOCORE_SESSION,
35-
DEPRECATED_PROFILE_NAME,
36-
DEPRECATED_REGION,
37-
DEPRECATED_SECRET_ACCESS_KEY,
38-
DEPRECATED_SESSION_TOKEN,
3934
ICEBERG,
4035
METADATA_LOCATION,
4136
PREVIOUS_METADATA_LOCATION,
@@ -102,18 +97,12 @@ def __init__(self, name: str, **properties: str):
10297
super().__init__(name, **properties)
10398

10499
session = boto3.Session(
105-
profile_name=get_first_property_value(properties, DYNAMODB_PROFILE_NAME, DEPRECATED_PROFILE_NAME),
106-
region_name=get_first_property_value(properties, DYNAMODB_REGION, AWS_REGION, DEPRECATED_REGION),
100+
profile_name=properties.get(DYNAMODB_PROFILE_NAME),
101+
region_name=get_first_property_value(properties, DYNAMODB_REGION, AWS_REGION),
107102
botocore_session=properties.get(DEPRECATED_BOTOCORE_SESSION),
108-
aws_access_key_id=get_first_property_value(
109-
properties, DYNAMODB_ACCESS_KEY_ID, AWS_ACCESS_KEY_ID, DEPRECATED_ACCESS_KEY_ID
110-
),
111-
aws_secret_access_key=get_first_property_value(
112-
properties, DYNAMODB_SECRET_ACCESS_KEY, AWS_SECRET_ACCESS_KEY, DEPRECATED_SECRET_ACCESS_KEY
113-
),
114-
aws_session_token=get_first_property_value(
115-
properties, DYNAMODB_SESSION_TOKEN, AWS_SESSION_TOKEN, DEPRECATED_SESSION_TOKEN
116-
),
103+
aws_access_key_id=get_first_property_value(properties, DYNAMODB_ACCESS_KEY_ID, AWS_ACCESS_KEY_ID),
104+
aws_secret_access_key=get_first_property_value(properties, DYNAMODB_SECRET_ACCESS_KEY, AWS_SECRET_ACCESS_KEY),
105+
aws_session_token=get_first_property_value(properties, DYNAMODB_SESSION_TOKEN, AWS_SESSION_TOKEN),
117106
)
118107
self.dynamodb = session.client(DYNAMODB_CLIENT)
119108
self.dynamodb_table_name = self.properties.get(DYNAMODB_TABLE_NAME, DYNAMODB_TABLE_NAME_DEFAULT)
@@ -397,7 +386,7 @@ def drop_namespace(self, namespace: Union[str, Identifier]) -> None:
397386
raise NoSuchNamespaceError(f"Database does not exist: {database_name}") from e
398387

399388
def list_tables(self, namespace: Union[str, Identifier]) -> List[Identifier]:
400-
"""List tables under the given namespace in the catalog (including non-Iceberg tables).
389+
"""List Iceberg tables under the given namespace in the catalog.
401390
402391
Args:
403392
namespace (str | Identifier): Namespace identifier to search.

pyiceberg/catalog/glue.py

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,7 @@
4040
)
4141

4242
from pyiceberg.catalog import (
43-
DEPRECATED_ACCESS_KEY_ID,
4443
DEPRECATED_BOTOCORE_SESSION,
45-
DEPRECATED_PROFILE_NAME,
46-
DEPRECATED_REGION,
47-
DEPRECATED_SECRET_ACCESS_KEY,
48-
DEPRECATED_SESSION_TOKEN,
4944
EXTERNAL_TABLE,
5045
ICEBERG,
5146
LOCATION,
@@ -303,18 +298,12 @@ def __init__(self, name: str, **properties: Any):
303298
super().__init__(name, **properties)
304299

305300
session = boto3.Session(
306-
profile_name=get_first_property_value(properties, GLUE_PROFILE_NAME, DEPRECATED_PROFILE_NAME),
307-
region_name=get_first_property_value(properties, GLUE_REGION, AWS_REGION, DEPRECATED_REGION),
301+
profile_name=properties.get(GLUE_PROFILE_NAME),
302+
region_name=get_first_property_value(properties, GLUE_REGION, AWS_REGION),
308303
botocore_session=properties.get(DEPRECATED_BOTOCORE_SESSION),
309-
aws_access_key_id=get_first_property_value(
310-
properties, GLUE_ACCESS_KEY_ID, AWS_ACCESS_KEY_ID, DEPRECATED_ACCESS_KEY_ID
311-
),
312-
aws_secret_access_key=get_first_property_value(
313-
properties, GLUE_SECRET_ACCESS_KEY, AWS_SECRET_ACCESS_KEY, DEPRECATED_SECRET_ACCESS_KEY
314-
),
315-
aws_session_token=get_first_property_value(
316-
properties, GLUE_SESSION_TOKEN, AWS_SESSION_TOKEN, DEPRECATED_SESSION_TOKEN
317-
),
304+
aws_access_key_id=get_first_property_value(properties, GLUE_ACCESS_KEY_ID, AWS_ACCESS_KEY_ID),
305+
aws_secret_access_key=get_first_property_value(properties, GLUE_SECRET_ACCESS_KEY, AWS_SECRET_ACCESS_KEY),
306+
aws_session_token=get_first_property_value(properties, GLUE_SESSION_TOKEN, AWS_SESSION_TOKEN),
318307
)
319308
self.glue: GlueClient = session.client("glue", endpoint_url=properties.get(GLUE_CATALOG_ENDPOINT))
320309

@@ -670,7 +659,7 @@ def drop_namespace(self, namespace: Union[str, Identifier]) -> None:
670659
self.glue.delete_database(Name=database_name)
671660

672661
def list_tables(self, namespace: Union[str, Identifier]) -> List[Identifier]:
673-
"""List tables under the given namespace in the catalog (including non-Iceberg tables).
662+
"""List Iceberg tables under the given namespace in the catalog.
674663
675664
Args:
676665
namespace (str | Identifier): Namespace identifier to search.
@@ -698,7 +687,7 @@ def list_tables(self, namespace: Union[str, Identifier]) -> List[Identifier]:
698687

699688
except self.glue.exceptions.EntityNotFoundException as e:
700689
raise NoSuchNamespaceError(f"Database does not exist: {database_name}") from e
701-
return [(database_name, table["Name"]) for table in table_list]
690+
return [(database_name, table["Name"]) for table in table_list if self.__is_iceberg_table(table)]
702691

703692
def list_namespaces(self, namespace: Union[str, Identifier] = ()) -> List[Identifier]:
704693
"""List namespaces from the given namespace. If not given, list top-level namespaces from the catalog.
@@ -781,3 +770,7 @@ def list_views(self, namespace: Union[str, Identifier]) -> List[Identifier]:
781770

782771
def drop_view(self, identifier: Union[str, Identifier]) -> None:
783772
raise NotImplementedError
773+
774+
@staticmethod
775+
def __is_iceberg_table(table: TableTypeDef) -> bool:
776+
return table.get("Parameters", {}).get("table_type", "").lower() == ICEBERG

0 commit comments

Comments
 (0)