|
50 | 50 | AWS_REGION, |
51 | 51 | AWS_SECRET_ACCESS_KEY, |
52 | 52 | AWS_SESSION_TOKEN, |
| 53 | + DEPRECATED_ADLFS_ACCOUNT_KEY, |
| 54 | + DEPRECATED_ADLFS_ACCOUNT_NAME, |
| 55 | + DEPRECATED_ADLFS_CLIENT_ID, |
| 56 | + DEPRECATED_ADLFS_CONNECTION_STRING, |
| 57 | + DEPRECATED_ADLFS_PREFIX, |
| 58 | + DEPRECATED_ADLFS_SAS_TOKEN, |
| 59 | + DEPRECATED_ADLFS_TENANT_ID, |
53 | 60 | GCS_ACCESS, |
54 | 61 | GCS_CACHE_TIMEOUT, |
55 | 62 | GCS_CONSISTENCY, |
|
69 | 76 | S3_SESSION_TOKEN, |
70 | 77 | S3_SIGNER_URI, |
71 | 78 | ADLFS_ClIENT_SECRET, |
| 79 | + DEPRECATED_ADLFS_ClIENT_SECRET, |
72 | 80 | FileIO, |
73 | 81 | InputFile, |
74 | 82 | InputStream, |
75 | 83 | OutputFile, |
76 | 84 | OutputStream, |
77 | 85 | ) |
| 86 | +from pyiceberg.table import PropertyUtil |
78 | 87 | from pyiceberg.typedef import Properties |
| 88 | +from pyiceberg.utils.deprecated import deprecated |
79 | 89 |
|
80 | 90 | logger = logging.getLogger(__name__) |
81 | 91 |
|
@@ -176,14 +186,50 @@ def _gs(properties: Properties) -> AbstractFileSystem: |
176 | 186 | def _adlfs(properties: Properties) -> AbstractFileSystem: |
177 | 187 | from adlfs import AzureBlobFileSystem |
178 | 188 |
|
| 189 | + for property_name in properties: |
| 190 | + if property_name.startswith(DEPRECATED_ADLFS_PREFIX): |
| 191 | + deprecated( |
| 192 | + deprecated_in="0.7.0", |
| 193 | + removed_in="0.8.0", |
| 194 | + help_message=f"The property {property_name} is deprecated. Please use properties that start with adls.", |
| 195 | + )(lambda: None)() |
| 196 | + |
179 | 197 | return AzureBlobFileSystem( |
180 | | - connection_string=properties.get(ADLFS_CONNECTION_STRING), |
181 | | - account_name=properties.get(ADLFS_ACCOUNT_NAME), |
182 | | - account_key=properties.get(ADLFS_ACCOUNT_KEY), |
183 | | - sas_token=properties.get(ADLFS_SAS_TOKEN), |
184 | | - tenant_id=properties.get(ADLFS_TENANT_ID), |
185 | | - client_id=properties.get(ADLFS_CLIENT_ID), |
186 | | - client_secret=properties.get(ADLFS_ClIENT_SECRET), |
| 198 | + connection_string=PropertyUtil.get_first_property_value( |
| 199 | + properties, |
| 200 | + ADLFS_CONNECTION_STRING, |
| 201 | + DEPRECATED_ADLFS_CONNECTION_STRING, |
| 202 | + ), |
| 203 | + account_name=PropertyUtil.get_first_property_value( |
| 204 | + properties, |
| 205 | + ADLFS_ACCOUNT_NAME, |
| 206 | + DEPRECATED_ADLFS_ACCOUNT_NAME, |
| 207 | + ), |
| 208 | + account_key=PropertyUtil.get_first_property_value( |
| 209 | + properties, |
| 210 | + ADLFS_ACCOUNT_KEY, |
| 211 | + DEPRECATED_ADLFS_ACCOUNT_KEY, |
| 212 | + ), |
| 213 | + sas_token=PropertyUtil.get_first_property_value( |
| 214 | + properties, |
| 215 | + ADLFS_SAS_TOKEN, |
| 216 | + DEPRECATED_ADLFS_SAS_TOKEN, |
| 217 | + ), |
| 218 | + tenant_id=PropertyUtil.get_first_property_value( |
| 219 | + properties, |
| 220 | + ADLFS_TENANT_ID, |
| 221 | + DEPRECATED_ADLFS_TENANT_ID, |
| 222 | + ), |
| 223 | + client_id=PropertyUtil.get_first_property_value( |
| 224 | + properties, |
| 225 | + ADLFS_CLIENT_ID, |
| 226 | + DEPRECATED_ADLFS_CLIENT_ID, |
| 227 | + ), |
| 228 | + client_secret=PropertyUtil.get_first_property_value( |
| 229 | + properties, |
| 230 | + ADLFS_ClIENT_SECRET, |
| 231 | + DEPRECATED_ADLFS_ClIENT_SECRET, |
| 232 | + ), |
187 | 233 | ) |
188 | 234 |
|
189 | 235 |
|
|
0 commit comments