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

[Bug] economy/events Error: Expecting value: line 1 column 1 (char 0) #2919

Closed
colin99d opened this issue Oct 19, 2022 · 2 comments · Fixed by #2902
Closed

[Bug] economy/events Error: Expecting value: line 1 column 1 (char 0) #2919

colin99d opened this issue Oct 19, 2022 · 2 comments · Fixed by #2902
Assignees
Labels
bug Fix bug build Build-related work HACKTOBERFEST Hacktoberfest

Comments

@colin99d
Copy link
Contributor

Screen Shot 2022-10-19 at 2 09 46 PM

Note. This happened on the newest pip package build.

@colin99d colin99d added the bug Fix bug label Oct 19, 2022
@github-actions github-actions bot added the build Build-related work label Oct 19, 2022
@kairosdojo
Copy link
Contributor

kairosdojo commented Oct 19, 2022

The problem arises from this line:

    except Exception:
        data = investpy.news.economic_calendar(
            None,
            time_filter,
            countries_list,
            importances_list,
            categories_list,
            start_date_string,
            end_date_string,
        )

and it seems connected to investpy (alvarobartt/investpy#615).

After that block, we check whether it is empty yet the variable data is not even created.

A possible solution is to encapsulate that piece of Exception code inside another try/except block and in case it fails we initialize data as None (and then check to see that's not None to continue) but... is it the right way? Maybe we should stick with the previous version of investpy untill fixed?

@jmaslek
Copy link
Collaborator

jmaslek commented Oct 19, 2022

The problem arises from this line:

    except Exception:
        data = investpy.news.economic_calendar(
            None,
            time_filter,
            countries_list,
            importances_list,
            categories_list,
            start_date_string,
            end_date_string,
        )

and it seems connected to investpy (alvarobartt/investpy#615).

After that block, we check whether it is empty yet the variable data is not even created.

A possible solution is to encapsulate that piece of Exception code inside another try/except block and in case it fails we initialize data as None (and then check to see that's not None to continue) but... is it the right way? Maybe we should stick with the previous version of investpy untill fixed?

I believe that the errors from investpy are due to a change in investing.com and how they are now protected bycloudflare or something, not the actual package. Using an old investpy version unfortunately won't solve this so we either need to wait or add a separate source for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fix bug build Build-related work HACKTOBERFEST Hacktoberfest
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants