Feature/astronomy#142
Conversation
…into feature/astronomy
app/internal/astronomy.py
Outdated
| input_query_string = dict(key=config.ASTRONOMY_API_KEY, q=location, | ||
| dt=formatted_date) | ||
| try: | ||
| response = requests.request("GET", ASTRONOMY_URL, |
There was a problem hiding this comment.
Prefer to work with async library (like httpx)
There was a problem hiding this comment.
I've changed to asyncio and the code runs fine from the main program,
But the test checks (which runs perfectly on my computer) just fails here:
https://github.com/PythonFreeCourse/calendar/pull/142/checks?check_run_id=1799100569
Couldn't find and information regarding to what causes the problem...
Any advice?
There was a problem hiding this comment.
I think that's because you mock using responses which is more suitable to requests than to httpx
There was a problem hiding this comment.
Thanks. You're right of course. Now I've changed it and it seems that my tests are fine and yet, there is an error in: tests/test_whatsapp.py::test_end_to_end_testing ERROR
https://github.com/PythonFreeCourse/calendar/pull/142/checks?check_run_id=1809067309
I've no idea on how my code could impact that...
Can you take a look again please?
There was a problem hiding this comment.
I think it some caveats in the work with async frameworks.
Can you please return get_data_from_api(formatted_date, location) instead of putting it in a async loop?
There was a problem hiding this comment.
Since I use async and httpx I think have to perform the loop - is there another way? or maybe you wanted me not to use async and httpx at all?
I've tried to do it prior to the return command, but still the whatsapp test fails...
Codecov Report
@@ Coverage Diff @@
## develop #142 +/- ##
===========================================
+ Coverage 99.38% 99.39% +0.01%
===========================================
Files 37 38 +1
Lines 1456 1489 +33
===========================================
+ Hits 1447 1480 +33
Misses 9 9
Continue to review full report at Codecov.
|
…into feature/astronomy
…into feature/astronomy
…astronomy # Conflicts: # requirements.txt
…into feature/astronomy
…into feature/astronomy
This feature gets astronomical data for given date & location.
It returns the following:
Status - success / failure (+ ErrorDescription).
Location - relevant location values: name, region, country, lat, lon etc.
Astronomical data in local time: sunrise, sunset, moonrise, moonset, moon_phase, moon_illumination.