Skip to content

Commit 69e76cb

Browse files
committed
remove deprecation_message
1 parent f5c349c commit 69e76cb

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

pyiceberg/cli/console.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
from pyiceberg.io import WAREHOUSE
3434
from pyiceberg.table import TableProperties
3535
from pyiceberg.table.refs import SnapshotRef, SnapshotRefType
36-
from pyiceberg.utils.deprecated import deprecation_message
3736
from pyiceberg.utils.properties import property_as_int
3837

3938

@@ -237,14 +236,9 @@ def location(ctx: Context, identifier: str) -> None:
237236
@click.pass_context
238237
@catch_exception()
239238
def version(ctx: Context) -> None:
240-
"""Print pyiceberg's installed package number (deprecated, use ``--version`` instead)."""
241-
deprecation_message(
242-
deprecated_in="0.11.0",
243-
removed_in="1.0.0",
244-
help_message="Please use `pyiceberg --version` instead of `pyiceberg version`",
245-
)
239+
"""Print the installed pyiceberg package number (deprecated, use --version instead)."""
246240
click.echo(
247-
"Deprecation warning: the `version` command is deprecated and will be removed in 1.0.0. "
241+
"Deprecation warning: the `version` command is deprecated and will be removed in 0.13.0. "
248242
"Please use `pyiceberg --version` instead.",
249243
err=True,
250244
)

tests/cli/test_console.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,14 @@ def test_hive_catalog_missing_uri_shows_helpful_error(mocker: MockFixture) -> No
6262
assert "'uri'" not in result.output
6363

6464

65-
@pytest.mark.filterwarnings(
66-
"ignore:Deprecated in 0.11.0, will be removed in 1.0.0. "
67-
"Please use `pyiceberg --version` instead of `pyiceberg version`:DeprecationWarning"
68-
)
6965
def test_version_does_not_load_catalog(mocker: MockFixture) -> None:
7066
mock_load_catalog = mocker.patch("pyiceberg.cli.console.load_catalog", side_effect=Exception("should not be called"))
7167

7268
runner = CliRunner()
7369
result = runner.invoke(run, ["version"])
7470

7571
assert result.exit_code == 0
76-
assert __version__ in result.output
72+
assert result.stdout == f"{__version__}\n"
7773
mock_load_catalog.assert_not_called()
7874

7975

@@ -85,14 +81,12 @@ def test_version_flag() -> None:
8581
assert result.output == f"{__version__}\n"
8682

8783

88-
def test_version_command_emits_deprecation_warning(mocker: MockFixture) -> None:
89-
mocker.patch("pyiceberg.cli.console.load_catalog")
90-
84+
def test_version_command_emits_deprecation_warning() -> None:
9185
runner = CliRunner()
92-
with pytest.warns(DeprecationWarning, match="Please use `pyiceberg --version` instead of `pyiceberg version`"):
93-
result = runner.invoke(run, ["version"])
86+
result = runner.invoke(run, ["version"])
9487

9588
assert result.exit_code == 0
89+
assert __version__ in result.output
9690
assert "deprecated" in result.output.lower()
9791
assert "pyiceberg --version" in result.output
9892

0 commit comments

Comments
 (0)