This is an automated email from the ASF dual-hosted git repository.
emaynard pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git
The following commit(s) were added to refs/heads/main by this push:
new 989e99ae5 PySpark Update AWS Region (#1302)
989e99ae5 is described below
commit 989e99ae51f6cef0c093a86a4e51796f99a6894d
Author: Travis Bowen <[email protected]>
AuthorDate: Mon Apr 7 10:21:46 2025 -0700
PySpark Update AWS Region (#1302)
Co-authored-by: Travis Bowen <[email protected]>
---
regtests/t_pyspark/src/iceberg_spark.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/regtests/t_pyspark/src/iceberg_spark.py
b/regtests/t_pyspark/src/iceberg_spark.py
index cd0c4ade5..339888ef8 100644
--- a/regtests/t_pyspark/src/iceberg_spark.py
+++ b/regtests/t_pyspark/src/iceberg_spark.py
@@ -18,6 +18,7 @@
#
"""Spark connector with different catalog types."""
+import os
from typing import Any, Dict, List, Optional, Union
from pyspark.errors import PySparkRuntimeError
@@ -43,7 +44,7 @@ class IcebergSparkSession:
self,
bearer_token: str = None,
credentials: str = None,
- aws_region: str = "us-west-2",
+ aws_region: str = None,
catalog_name: str = None,
polaris_url: str = None,
realm: str = 'POLARIS'
@@ -51,7 +52,8 @@ class IcebergSparkSession:
"""Constructor for Iceberg Spark session. Sets the member variables."""
self.bearer_token = bearer_token
self.credentials = credentials
- self.aws_region = aws_region
+ if aws_region is None:
+ self.aws_region = os.environ.get('AWS_REGION', 'us-west-2')
self.catalog_name = catalog_name
self.polaris_url = polaris_url
self.realm = realm