Skip to content

Drop Functionality Deprecated in v20.x #4671

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

Merged
merged 18 commits into from
Mar 15, 2025
Merged

Drop Functionality Deprecated in v20.x #4671

merged 18 commits into from
Mar 15, 2025

Conversation

Bibo-Joshi
Copy link
Member

@Bibo-Joshi Bibo-Joshi commented Feb 6, 2025

when done, closes #4659

endet up skipping one item of #4659 - please see the comments there.
please also have a look if you find anything else that we should deprecate.

  • add/update chango fragment

@Bibo-Joshi Bibo-Joshi added the 🛠 breaking change type: breaking label Feb 6, 2025
Copy link

codecov bot commented Feb 6, 2025

❌ 10 Tests Failed:

Tests completed Failed Passed Skipped
6503 10 6493 517
View the top 3 failed tests by shortest run time
tests._passport.test_passportfile.TestPassportFileWithoutRequest::test_de_json_localization[UTC-ZoneInfo]
Stack Traces | 0.002s run time
self = <tests._passport.test_passportfile.TestPassportFileWithoutRequest object at 0x000001E95D954350>
passport_file = PassportFile(file_date=datetime.datetime(2025, 2, 6, 16, 34, 42, tzinfo=datetime.timezone.utc), file_id='data', file_size=50, file_unique_id='adc3145fd2e84d95b64d68eaa22aa33e')
tz_bot = PytestExtBot[token=5737018356:AAH138SuiKQF0LDCWsfgWeXfjJ5d63kCWLA]
offline_bot = PytestExtBot[token=5737018356:AAH138SuiKQF0LDCWsfgWeXfjJ5d63kCWLA]
raw_bot = PytestBot[token=5737018356:AAH138SuiKQF0LDCWsfgWeXfjJ5d63kCWLA]

    def test_de_json_localization(self, passport_file, tz_bot, offline_bot, raw_bot):
        json_dict = {
            "file_id": self.file_id,
            "file_unique_id": self.file_unique_id,
            "file_size": self.file_size,
            "file_date": to_timestamp(self.file_date),
        }
    
        pf = PassportFile.de_json(json_dict, offline_bot)
        pf_raw = PassportFile.de_json(json_dict, raw_bot)
        pf_tz = PassportFile.de_json(json_dict, tz_bot)
    
        # comparing utcoffsets because comparing timezones is unpredicatable
        date_offset = pf_tz.file_date.utcoffset()
        tz_bot_offset = tz_bot.defaults.tzinfo.utcoffset(
>           pf_tz.subscription_expiration_date.replace(tzinfo=None)
        )
E       AttributeError: 'PassportFile' object has no attribute 'subscription_expiration_date'

tests\_passport\test_passportfile.py:89: AttributeError
tests._passport.test_passportfile.TestPassportFileWithoutRequest::test_to_dict
Stack Traces | 0.002s run time
self = <tests._passport.test_passportfile.TestPassportFileWithoutRequest object at 0x000001E95D8BEC40>
passport_file = PassportFile(file_date=datetime.datetime(2025, 2, 6, 16, 34, 42, tzinfo=datetime.timezone.utc), file_id='data', file_size=50, file_unique_id='adc3145fd2e84d95b64d68eaa22aa33e')

    def test_to_dict(self, passport_file):
        passport_file_dict = passport_file.to_dict()
    
        assert isinstance(passport_file_dict, dict)
        assert passport_file_dict["file_id"] == passport_file.file_id
        assert passport_file_dict["file_unique_id"] == passport_file.file_unique_id
        assert passport_file_dict["file_size"] == passport_file.file_size
>       assert passport_file_dict["file_date"] == passport_file.file_date
E       AssertionError: assert 1738859682 == datetime.datetime(2025, 2, 6, 16, 34, 42, tzinfo=datetime.timezone.utc)
E        +  where datetime.datetime(2025, 2, 6, 16, 34, 42, tzinfo=datetime.timezone.utc) = PassportFile(file_date=datetime.datetime(2025, 2, 6, 16, 34, 42, tzinfo=datetime.timezone.utc), file_id='data', file_size=50, file_unique_id='adc3145fd2e84d95b64d68eaa22aa33e').file_date

tests\_passport\test_passportfile.py:72: AssertionError
tests._passport.test_passportfile.TestPassportFileWithoutRequest::test_de_json_localization[Europe/Berlin-timezone]
Stack Traces | 0.003s run time
self = <tests._passport.test_passportfile.TestPassportFileWithoutRequest object at 0x000001996ADBED70>
passport_file = PassportFile(file_date=datetime.datetime(2025, 2, 6, 16, 34, 41, tzinfo=datetime.timezone.utc), file_id='data', file_size=50, file_unique_id='adc3145fd2e84d95b64d68eaa22aa33e')
tz_bot = PytestExtBot[token=5737018356:AAH138SuiKQF0LDCWsfgWeXfjJ5d63kCWLA]
offline_bot = PytestExtBot[token=5737018356:AAH138SuiKQF0LDCWsfgWeXfjJ5d63kCWLA]
raw_bot = PytestBot[token=5737018356:AAH138SuiKQF0LDCWsfgWeXfjJ5d63kCWLA]

    def test_de_json_localization(self, passport_file, tz_bot, offline_bot, raw_bot):
        json_dict = {
            "file_id": self.file_id,
            "file_unique_id": self.file_unique_id,
            "file_size": self.file_size,
            "file_date": to_timestamp(self.file_date),
        }
    
        pf = PassportFile.de_json(json_dict, offline_bot)
        pf_raw = PassportFile.de_json(json_dict, raw_bot)
        pf_tz = PassportFile.de_json(json_dict, tz_bot)
    
        # comparing utcoffsets because comparing timezones is unpredicatable
        date_offset = pf_tz.file_date.utcoffset()
        tz_bot_offset = tz_bot.defaults.tzinfo.utcoffset(
>           pf_tz.subscription_expiration_date.replace(tzinfo=None)
        )
E       AttributeError: 'PassportFile' object has no attribute 'subscription_expiration_date'

tests\_passport\test_passportfile.py:89: AttributeError

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

Copy link
Member

@Poolitzer Poolitzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cant find a way to review that line but

"20.7",
f"The class {self._request[0].__class__.__name__} does not override "
"the property `read_timeout`. Overriding this property will be mandatory "
"in future versions. Using 2 seconds as fallback.",
is missing right?

And should we update the version in create task callback so people dont think we missed it/it will be deprecated

@Bibo-Joshi Bibo-Joshi marked this pull request as ready for review February 9, 2025 15:30
@Bibo-Joshi Bibo-Joshi added the 📋 do-not-merge-yet work status: do-not-merge-yet label Feb 9, 2025
# Conflicts:
#	telegram/ext/_application.py
#	telegram/ext/_updater.py
#	tests/test_official/exceptions.py
@Bibo-Joshi Bibo-Joshi merged commit 1cf000c into master Mar 15, 2025
42 of 43 checks passed
@Bibo-Joshi Bibo-Joshi deleted the v22-deprecations branch March 15, 2025 08:21
@github-actions github-actions bot locked and limited conversation to collaborators Mar 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🛠 breaking change type: breaking 📋 do-not-merge-yet work status: do-not-merge-yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v22
2 participants