Skip to content

Commit acd6f5a

Browse files
authored
Remove deprecation warnings (apache#1416)
* tests/expressions/test_parser.py::test_is_null Deprecated in 0.8.0, will be removed in 0.9.0. Parsing expressions with table name is deprecated. Only provide field names in the row_filter. * tests/catalog/test_rest.py: Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI configuration
1 parent f863c4e commit acd6f5a

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

pyiceberg/utils/deprecated.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ def deprecation_message(deprecated_in: str, removed_in: str, help_message: Optio
5656

5757
def _deprecation_warning(message: str) -> None:
5858
with warnings.catch_warnings(): # temporarily override warning handling
59-
warnings.simplefilter("always", DeprecationWarning) # turn off filter
6059
warnings.warn(
6160
message,
6261
category=DeprecationWarning,

tests/catalog/test_rest.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ def test_no_uri_supplied() -> None:
121121
RestCatalog("production")
122122

123123

124+
@pytest.mark.filterwarnings(
125+
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning"
126+
)
124127
def test_token_200(rest_mock: Mocker) -> None:
125128
rest_mock.post(
126129
f"{TEST_URI}v1/oauth/tokens",
@@ -141,6 +144,9 @@ def test_token_200(rest_mock: Mocker) -> None:
141144
)
142145

143146

147+
@pytest.mark.filterwarnings(
148+
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning"
149+
)
144150
def test_token_200_without_optional_fields(rest_mock: Mocker) -> None:
145151
rest_mock.post(
146152
f"{TEST_URI}v1/oauth/tokens",
@@ -157,6 +163,9 @@ def test_token_200_without_optional_fields(rest_mock: Mocker) -> None:
157163
)
158164

159165

166+
@pytest.mark.filterwarnings(
167+
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning"
168+
)
160169
def test_token_with_optional_oauth_params(rest_mock: Mocker) -> None:
161170
mock_request = rest_mock.post(
162171
f"{TEST_URI}v1/oauth/tokens",
@@ -179,6 +188,9 @@ def test_token_with_optional_oauth_params(rest_mock: Mocker) -> None:
179188
assert TEST_RESOURCE in mock_request.last_request.text
180189

181190

191+
@pytest.mark.filterwarnings(
192+
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning"
193+
)
182194
def test_token_with_optional_oauth_params_as_empty(rest_mock: Mocker) -> None:
183195
mock_request = rest_mock.post(
184196
f"{TEST_URI}v1/oauth/tokens",
@@ -199,6 +211,9 @@ def test_token_with_optional_oauth_params_as_empty(rest_mock: Mocker) -> None:
199211
assert TEST_RESOURCE not in mock_request.last_request.text
200212

201213

214+
@pytest.mark.filterwarnings(
215+
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning"
216+
)
202217
def test_token_with_default_scope(rest_mock: Mocker) -> None:
203218
mock_request = rest_mock.post(
204219
f"{TEST_URI}v1/oauth/tokens",
@@ -217,6 +232,9 @@ def test_token_with_default_scope(rest_mock: Mocker) -> None:
217232
assert "catalog" in mock_request.last_request.text
218233

219234

235+
@pytest.mark.filterwarnings(
236+
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning"
237+
)
220238
def test_token_with_custom_scope(rest_mock: Mocker) -> None:
221239
mock_request = rest_mock.post(
222240
f"{TEST_URI}v1/oauth/tokens",
@@ -236,6 +254,9 @@ def test_token_with_custom_scope(rest_mock: Mocker) -> None:
236254
assert TEST_SCOPE in mock_request.last_request.text
237255

238256

257+
@pytest.mark.filterwarnings(
258+
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning"
259+
)
239260
def test_token_200_w_auth_url(rest_mock: Mocker) -> None:
240261
rest_mock.post(
241262
TEST_AUTH_URL,
@@ -258,6 +279,9 @@ def test_token_200_w_auth_url(rest_mock: Mocker) -> None:
258279
# pylint: enable=W0212
259280

260281

282+
@pytest.mark.filterwarnings(
283+
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning"
284+
)
261285
def test_config_200(requests_mock: Mocker) -> None:
262286
requests_mock.get(
263287
f"{TEST_URI}v1/config",
@@ -343,6 +367,9 @@ def test_config_sets_headers(requests_mock: Mocker) -> None:
343367
)
344368

345369

370+
@pytest.mark.filterwarnings(
371+
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning"
372+
)
346373
def test_token_400(rest_mock: Mocker) -> None:
347374
rest_mock.post(
348375
f"{TEST_URI}v1/oauth/tokens",
@@ -356,6 +383,9 @@ def test_token_400(rest_mock: Mocker) -> None:
356383
assert str(e.value) == "invalid_client: Credentials for key invalid_key do not match"
357384

358385

386+
@pytest.mark.filterwarnings(
387+
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning"
388+
)
359389
def test_token_401(rest_mock: Mocker) -> None:
360390
message = "invalid_client"
361391
rest_mock.post(
@@ -489,6 +519,9 @@ def test_list_namespace_with_parent_200(rest_mock: Mocker) -> None:
489519
]
490520

491521

522+
@pytest.mark.filterwarnings(
523+
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning"
524+
)
492525
def test_list_namespaces_token_expired(rest_mock: Mocker) -> None:
493526
new_token = "new_jwt_token"
494527
new_header = dict(TEST_HEADERS)

tests/expressions/test_parser.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ def test_equals_false() -> None:
7070
def test_is_null() -> None:
7171
assert IsNull("foo") == parser.parse("foo is null")
7272
assert IsNull("foo") == parser.parse("foo IS NULL")
73-
assert IsNull("foo") == parser.parse("table.foo IS NULL")
7473

7574

7675
def test_not_null() -> None:

0 commit comments

Comments
 (0)