Skip to content

Commit fe2b225

Browse files
authored
fix: deprecate Lake Formation Governed Tables (BREAKING CHANGE) (#2692)
1 parent 676e1c1 commit fe2b225

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+121
-2351
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ To run all database MySQL tests (Using 8 parallel processes):
224224

225225
``pytest -n 8 tests/unit/test_mysql.py``
226226

227-
To run all tests for all python versions (assuming Amazon QuickSight is activated and the optional stacks deployed):
227+
To run all tests for all python versions (assuming Amazon QuickSight is activated and the optional stack deployed):
228228

229229
``./test.sh``
230230

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ The quickest way to get started is to use AWS Glue with Ray. Read our [docs](htt
153153
- [029 - S3 Select](https://github.com/aws/aws-sdk-pandas/blob/main/tutorials/029%20-%20S3%20Select.ipynb)
154154
- [030 - Data Api](https://github.com/aws/aws-sdk-pandas/blob/main/tutorials/030%20-%20Data%20Api.ipynb)
155155
- [031 - OpenSearch](https://github.com/aws/aws-sdk-pandas/blob/main/tutorials/031%20-%20OpenSearch.ipynb)
156-
- [032 - Lake Formation Governed Tables](https://github.com/aws/aws-sdk-pandas/blob/main/tutorials/032%20-%20Lake%20Formation%20Governed%20Tables.ipynb)
157156
- [033 - Amazon Neptune](https://github.com/aws/aws-sdk-pandas/blob/main/tutorials/033%20-%20Amazon%20Neptune.ipynb)
158157
- [034 - Distributing Calls Using Ray](https://github.com/aws/aws-sdk-pandas/blob/main/tutorials/034%20-%20Distributing%20Calls%20using%20Ray.ipynb)
159158
- [035 - Distributing Calls on Ray Remote Cluster](https://github.com/aws/aws-sdk-pandas/blob/main/tutorials/035%20-%20Distributing%20Calls%20on%20Ray%20Remote%20Cluster.ipynb)
@@ -167,7 +166,6 @@ The quickest way to get started is to use AWS Glue with Ray. Read our [docs](htt
167166
- [Amazon S3](https://aws-sdk-pandas.readthedocs.io/en/3.6.0/api.html#amazon-s3)
168167
- [AWS Glue Catalog](https://aws-sdk-pandas.readthedocs.io/en/3.6.0/api.html#aws-glue-catalog)
169168
- [Amazon Athena](https://aws-sdk-pandas.readthedocs.io/en/3.6.0/api.html#amazon-athena)
170-
- [AWS Lake Formation](https://aws-sdk-pandas.readthedocs.io/en/3.6.0/api.html#aws-lake-formation)
171169
- [Amazon Redshift](https://aws-sdk-pandas.readthedocs.io/en/3.6.0/api.html#amazon-redshift)
172170
- [PostgreSQL](https://aws-sdk-pandas.readthedocs.io/en/3.6.0/api.html#postgresql)
173171
- [MySQL](https://aws-sdk-pandas.readthedocs.io/en/3.6.0/api.html#mysql)

awswrangler/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
emr,
2020
emr_serverless,
2121
exceptions,
22-
lakeformation,
2322
mysql,
2423
neptune,
2524
opensearch,
@@ -58,7 +57,6 @@
5857
"s3",
5958
"sts",
6059
"redshift",
61-
"lakeformation",
6260
"mysql",
6361
"neptune",
6462
"postgresql",

awswrangler/_config.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ class _ConfigArg(NamedTuple):
4444
"max_local_cache_entries": _ConfigArg(dtype=int, nullable=False, parent_parameter_key="athena_cache_settings"),
4545
"athena_query_wait_polling_delay": _ConfigArg(dtype=float, nullable=False),
4646
"cloudwatch_query_wait_polling_delay": _ConfigArg(dtype=float, nullable=False),
47-
"lakeformation_query_wait_polling_delay": _ConfigArg(dtype=float, nullable=False),
4847
"neptune_load_wait_polling_delay": _ConfigArg(dtype=float, nullable=False),
4948
"timestream_batch_load_wait_polling_delay": _ConfigArg(dtype=float, nullable=False),
5049
"emr_serverless_job_wait_polling_delay": _ConfigArg(dtype=float, nullable=False),
@@ -61,7 +60,6 @@ class _ConfigArg(NamedTuple):
6160
"redshift_endpoint_url": _ConfigArg(dtype=str, nullable=True, enforced=True, loaded=True),
6261
"kms_endpoint_url": _ConfigArg(dtype=str, nullable=True, enforced=True, loaded=True),
6362
"emr_endpoint_url": _ConfigArg(dtype=str, nullable=True, enforced=True, loaded=True),
64-
"lakeformation_endpoint_url": _ConfigArg(dtype=str, nullable=True, enforced=True, loaded=True),
6563
"dynamodb_endpoint_url": _ConfigArg(dtype=str, nullable=True, enforced=True, loaded=True),
6664
"secretsmanager_endpoint_url": _ConfigArg(dtype=str, nullable=True, enforced=True, loaded=True),
6765
"timestream_query_endpoint_url": _ConfigArg(dtype=str, nullable=True, enforced=True, loaded=True),
@@ -353,15 +351,6 @@ def cloudwatch_query_wait_polling_delay(self) -> float:
353351
def cloudwatch_query_wait_polling_delay(self, value: float) -> None:
354352
self._set_config_value(key="cloudwatch_query_wait_polling_delay", value=value)
355353

356-
@property
357-
def lakeformation_query_wait_polling_delay(self) -> float:
358-
"""Property lakeformation_query_wait_polling_delay."""
359-
return cast(float, self["lakeformation_query_wait_polling_delay"])
360-
361-
@lakeformation_query_wait_polling_delay.setter
362-
def lakeformation_query_wait_polling_delay(self, value: float) -> None:
363-
self._set_config_value(key="lakeformation_query_wait_polling_delay", value=value)
364-
365354
@property
366355
def neptune_load_wait_polling_delay(self) -> float:
367356
"""Property neptune_load_wait_polling_delay."""
@@ -497,15 +486,6 @@ def emr_endpoint_url(self) -> str | None:
497486
def emr_endpoint_url(self, value: str | None) -> None:
498487
self._set_config_value(key="emr_endpoint_url", value=value)
499488

500-
@property
501-
def lakeformation_endpoint_url(self) -> str | None:
502-
"""Property lakeformation_endpoint_url."""
503-
return cast(Optional[str], self["lakeformation_endpoint_url"])
504-
505-
@lakeformation_endpoint_url.setter
506-
def lakeformation_endpoint_url(self, value: str | None) -> None:
507-
self._set_config_value(key="lakeformation_endpoint_url", value=value)
508-
509489
@property
510490
def dynamodb_endpoint_url(self) -> str | None:
511491
"""Property dynamodb_endpoint_url."""

awswrangler/_utils.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
from mypy_boto3_emr_serverless import EMRServerlessClient
5252
from mypy_boto3_glue import GlueClient
5353
from mypy_boto3_kms.client import KMSClient
54-
from mypy_boto3_lakeformation.client import LakeFormationClient
5554
from mypy_boto3_logs.client import CloudWatchLogsClient
5655
from mypy_boto3_opensearch.client import OpenSearchServiceClient
5756
from mypy_boto3_opensearchserverless.client import OpenSearchServiceServerlessClient
@@ -75,7 +74,6 @@
7574
"emr-serverless",
7675
"glue",
7776
"kms",
78-
"lakeformation",
7977
"logs",
8078
"opensearch",
8179
"opensearchserverless",
@@ -267,8 +265,6 @@ def _get_endpoint_url(service_name: str) -> str | None:
267265
endpoint_url = _config.config.kms_endpoint_url
268266
elif service_name == "emr" and _config.config.emr_endpoint_url is not None:
269267
endpoint_url = _config.config.emr_endpoint_url
270-
elif service_name == "lakeformation" and _config.config.lakeformation_endpoint_url is not None:
271-
endpoint_url = _config.config.lakeformation_endpoint_url
272268
elif service_name == "dynamodb" and _config.config.dynamodb_endpoint_url is not None:
273269
endpoint_url = _config.config.dynamodb_endpoint_url
274270
elif service_name == "secretsmanager" and _config.config.secretsmanager_endpoint_url is not None:
@@ -301,16 +297,6 @@ def client(
301297
...
302298

303299

304-
@overload
305-
def client(
306-
service_name: 'Literal["lakeformation"]',
307-
session: boto3.Session | None = None,
308-
botocore_config: Config | None = None,
309-
verify: str | bool | None = None,
310-
) -> "LakeFormationClient":
311-
...
312-
313-
314300
@overload
315301
def client(
316302
service_name: 'Literal["logs"]',

awswrangler/athena/_utils.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
from awswrangler import _data_types, _utils, catalog, exceptions, s3, sts, typing
3131
from awswrangler._config import apply_configs
3232
from awswrangler._sql_formatter import _process_sql_params
33-
from awswrangler.catalog._utils import _catalog_id, _transaction_id
33+
from awswrangler.catalog._utils import _catalog_id
3434

3535
from . import _executions
3636
from ._cache import _cache_manager, _LocalMetadataCacheManager
@@ -935,8 +935,6 @@ def show_create_table(
935935
def generate_create_query(
936936
table: str,
937937
database: str | None = None,
938-
transaction_id: str | None = None,
939-
query_as_of_time: str | None = None,
940938
catalog_id: str | None = None,
941939
boto3_session: boto3.Session | None = None,
942940
) -> str:
@@ -950,11 +948,6 @@ def generate_create_query(
950948
Table name.
951949
database : str
952950
Database name.
953-
transaction_id: str, optional
954-
The ID of the transaction.
955-
query_as_of_time: str, optional
956-
The time as of when to read the table contents. Must be a valid Unix epoch timestamp.
957-
Cannot be specified alongside transaction_id.
958951
catalog_id : str, optional
959952
The ID of the Data Catalog from which to retrieve Databases.
960953
If none is provided, the AWS account ID is used by default.
@@ -992,14 +985,9 @@ def parse_properties(parameters: dict[str, str]) -> str:
992985
return ", \n".join(properties_str)
993986

994987
client_glue = _utils.client(service_name="glue", session=boto3_session)
995-
table_detail = client_glue.get_table(
996-
**_catalog_id(
997-
catalog_id=catalog_id,
998-
**_transaction_id(
999-
transaction_id=transaction_id, query_as_of_time=query_as_of_time, DatabaseName=database, Name=table
1000-
),
1001-
)
1002-
)["Table"]
988+
table_detail = client_glue.get_table(**_catalog_id(catalog_id=catalog_id, DatabaseName=database, Name=table))[
989+
"Table"
990+
]
1003991
if table_detail["TableType"] == "VIRTUAL_VIEW":
1004992
glue_base64_query: str = table_detail["ViewOriginalText"].replace("/* Presto View: ", "").replace(" */", "")
1005993
glue_query: str = json.loads(base64.b64decode(glue_base64_query))["originalSql"]

awswrangler/catalog/_add.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
_parquet_partition_definition,
1818
_update_table_definition,
1919
)
20-
from awswrangler.catalog._utils import _catalog_id, _transaction_id, sanitize_table_name
20+
from awswrangler.catalog._utils import _catalog_id, sanitize_table_name
2121

2222
_logger: logging.Logger = logging.getLogger(__name__)
2323

@@ -382,7 +382,6 @@ def add_column(
382382
column_name: str,
383383
column_type: str = "string",
384384
column_comment: str | None = None,
385-
transaction_id: str | None = None,
386385
boto3_session: boto3.Session | None = None,
387386
catalog_id: str | None = None,
388387
) -> None:
@@ -400,8 +399,6 @@ def add_column(
400399
Column type.
401400
column_comment : str
402401
Column Comment
403-
transaction_id: str, optional
404-
The ID of the transaction (i.e. used with GOVERNED tables).
405402
boto3_session : boto3.Session(), optional
406403
Boto3 Session. The default boto3 session will be used if boto3_session receive None.
407404
catalog_id : str, optional
@@ -425,21 +422,13 @@ def add_column(
425422
"""
426423
if _check_column_type(column_type):
427424
client_glue = _utils.client(service_name="glue", session=boto3_session)
428-
table_res = client_glue.get_table(
429-
**_catalog_id(
430-
catalog_id=catalog_id,
431-
**_transaction_id(transaction_id=transaction_id, DatabaseName=database, Name=table),
432-
)
433-
)
425+
table_res = client_glue.get_table(**_catalog_id(catalog_id=catalog_id, DatabaseName=database, Name=table))
434426
table_input: dict[str, Any] = _update_table_definition(table_res)
435427
table_input["StorageDescriptor"]["Columns"].append(
436428
{"Name": column_name, "Type": column_type, "Comment": column_comment}
437429
)
438430
res: dict[str, Any] = client_glue.update_table(
439-
**_catalog_id(
440-
catalog_id=catalog_id,
441-
**_transaction_id(transaction_id=transaction_id, DatabaseName=database, TableInput=table_input),
442-
)
431+
**_catalog_id(catalog_id=catalog_id, DatabaseName=database, TableInput=table_input)
443432
)
444433
if ("Errors" in res) and res["Errors"]:
445434
for error in res["Errors"]:

0 commit comments

Comments
 (0)