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

days_ago being to high causes analytics to break (#FirstIssue) #517

Open
brentspine opened this issue May 2, 2024 · 0 comments · May be fixed by #519
Open

days_ago being to high causes analytics to break (#FirstIssue) #517

brentspine opened this issue May 2, 2024 · 0 comments · May be fixed by #519

Comments

@brentspine
Copy link

Describe the bug

Setting days_ago to a number to high causes exceptions when reading logs and breaks the analytics server

Steps to reproduce

Do something like twitch_miner.analytics(host="127.0.0.1", port=5000, refresh=5, days_ago=365*1000000)

Expected behavior

Not break

Operating system

Windows 10 Home N

Python version

3.11.9

Miner version

1.9.5

Other relevant software versions

No response

Logs

02/05/24 19:01:29 - ERROR - [log_exception]: Exception on /json/streamer.json [GET]
Traceback (most recent call last):
File "C:\Users\youbo\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\flask\app.py", line 1463, in wsgi_app
response = self.full_dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\youbo\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\flask\app.py", line 872, in full_dispatch_request
rv = self.handle_user_exception(e)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\youbo\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\flask\app.py", line 870, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\youbo\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\flask\app.py", line 855, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\youbo\OneDrive\Dokumente\Twitch-Channel-Points-Miner-v2\TwitchChannelPointsMiner\classes\AnalyticsServer.py", line 133, in read_json
filtered_data = filter_datas(start_date, end_date, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\youbo\OneDrive\Dokumente\Twitch-Channel-Points-Miner-v2\TwitchChannelPointsMiner\classes\AnalyticsServer.py", line 46, in filter_datas
datetime.strptime(start_date, "%Y-%m-%d").timestamp() * 1000
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib_strptime.py", line 567, in _strptime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib_strptime.py", line 349, in _strptime
raise ValueError("time data %r does not match format %r" %
ValueError: time data 'NaN-NaN-NaN' does not match format '%Y-%m-%d'

Additional context

Solving issue myself

@brentspine brentspine linked a pull request May 4, 2024 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant