Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@deprecated shows no warnings wrapped around @api or @global_api #2623

Open
midichef opened this issue Dec 3, 2024 · 0 comments
Open

@deprecated shows no warnings wrapped around @api or @global_api #2623

midichef opened this issue Dec 3, 2024 · 0 comments
Labels

Comments

@midichef
Copy link
Contributor

midichef commented Dec 3, 2024

Small description
Functions that use the @deprecated decorator do not display the intended warnings, if @deprecated is wrapped around @VisiData.api or @Visidata.global_api or @visidata.[class].api.

Steps to reproduce
vd then press ^X and input sheet.keystr(sheet.cursorRow)

Expected result
I expect to see the warning keystr deprecated since v3.1; use sheet.rowname(row).

Actual result with screenshot
The deprecated function (such as keystr()) runs as expected, but no deprecation warning is shown.

Configuration
visidata v3.2dev
Python 3.12.3
Ubuntu 24.04

Additional context
If I reverse the order of the 2 decorators so that @deprecated comes after @api, the deprecation works as intended:

@visidata.TableSheet.api
@deprecated('3.1', 'sheet.rowname(row)')
def keystr(sheet, row):
    return sheet.rowname(row)

keystr deprecated since v3.1; use sheet.rowname(row)

@midichef midichef added the bug label Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant