Open solresol opened 7 months ago
None
)[!TIP] I can email you next time I complete a pull request if you set up your email here!
Here are the GitHub Actions logs prior to making any changes:
6f20658
Checking exporter.py for syntax errors... ✅ exporter.py has no syntax errors!
1/1 ✓Checking exporter.py for syntax errors... ✅ exporter.py has no syntax errors!
Sandbox passed on the latest main
, so sandbox checks will be enabled for this issue.
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
exporter.py
✓ https://github.com/solresol/solar-panel-astronomy/commit/e493fde57c01c13b24e28f4c7a48cebe63f22d9b Edit
Modify exporter.py with contents:
• Change the CREATE TABLE statement to create a table named 'weather_data' instead of 'weather'. The modified code should look like this: ``` CREATE TABLE IF NOT EXISTS weather_data ( when_recorded TIMESTAMP, clouds FLOAT ) ```
--- +++ @@ -52,13 +52,13 @@ def write_sqlite(conn, weather_data, astronomy_data): cursor = conn.cursor() cursor.execute(""" - CREATE TABLE IF NOT EXISTS weather ( + CREATE TABLE IF NOT EXISTS weather_data ( when_recorded TIMESTAMP, clouds FLOAT ) """) conn.commit() - cursor.execute("DELETE FROM weather") + cursor.execute("DELETE FROM weather_data") conn.commit() cursor.execute(""" CREATE TABLE IF NOT EXISTS astronomy ( @@ -75,7 +75,7 @@ cursor.execute("DELETE FROM astronomy") conn.commit() for i, record in enumerate(weather_data): - cursor.execute("INSERT INTO weather (when_recorded, clouds) VALUES (?, ?)", record) + cursor.execute("INSERT INTO weather_data (when_recorded, clouds) VALUES (?, ?)", record) if i % 1000 == 0: conn.commit() for i, record in enumerate(astronomy_data):
exporter.py
✓ Edit
Check exporter.py with contents:
Ran GitHub Actions for e493fde57c01c13b24e28f4c7a48cebe63f22d9b:
• build: ✓
exporter.py
! No changes made Edit
Modify exporter.py with contents:
• Change the DELETE FROM statement to delete from 'weather_data' instead of 'weather'. The modified code should look like this: ``` cursor.execute("DELETE FROM weather_data") ```
exporter.py
✗ Edit
Check exporter.py with contents:
exporter.py
! No changes made Edit
Modify exporter.py with contents:
• Change the INSERT INTO statement to insert into 'weather_data' instead of 'weather'. The modified code should look like this: ``` cursor.execute("INSERT INTO weather_data (when_recorded, clouds) VALUES (?, ?)", record) ```
exporter.py
✗ Edit
Check exporter.py with contents:
I have finished reviewing the code for completeness. I did not find errors for sweep/fix_database_bug
.
💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord
Details
There should be a table called weather_data, not weather. You'll need to fix exporter.py
Checklist
- [X] Modify `exporter.py` ✓ https://github.com/solresol/solar-panel-astronomy/commit/e493fde57c01c13b24e28f4c7a48cebe63f22d9b [Edit](https://github.com/solresol/solar-panel-astronomy/edit/sweep/fix_database_bug/exporter.py#L55-L58) - [X] Running GitHub Actions for `exporter.py` ✓ [Edit](https://github.com/solresol/solar-panel-astronomy/edit/sweep/fix_database_bug/exporter.py#L55-L58) - [X] Modify `exporter.py` ! No changes made [Edit](https://github.com/solresol/solar-panel-astronomy/edit/sweep/fix_database_bug/exporter.py#L61-L61) - [X] Running GitHub Actions for `exporter.py` ✗ [Edit](https://github.com/solresol/solar-panel-astronomy/edit/sweep/fix_database_bug/exporter.py#L61-L61) - [X] Modify `exporter.py` ! No changes made [Edit](https://github.com/solresol/solar-panel-astronomy/edit/sweep/fix_database_bug/exporter.py#L78-L78) - [X] Running GitHub Actions for `exporter.py` ✗ [Edit](https://github.com/solresol/solar-panel-astronomy/edit/sweep/fix_database_bug/exporter.py#L78-L78)