Skip to content

Commit

Permalink
fixup! fixup! Issue #656: make sure CsvJobDatabase uses expected dtypes
Browse files Browse the repository at this point in the history
  • Loading branch information
soxofaan committed Nov 13, 2024
1 parent f5eb8a3 commit 8c1fcd4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions openeo/extra/job_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,7 @@ def _is_valid_wkt(self, wkt: str) -> bool:
def read(self) -> pd.DataFrame:
df = pd.read_csv(
self.path,
# TODO: possible to avoid hidden coupling with MultiBackendJobManager here?
dtype={c: r.dtype for (c, r) in MultiBackendJobManager._COLUMN_REQUIREMENTS.items()},
)
if (
Expand Down
5 changes: 3 additions & 2 deletions tests/extra/test_job_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def start_job(row, connection, **kwargs):
assert metadata_path.exists()

def _create_basic_mocked_manager(self, requests_mock, tmp_path):
# TODO: separate aspects of job manager and dummy backends
# TODO: separate aspects of job manager and dummy backends (e.g. reuse DummyBackend here)
requests_mock.get("http://foo.test/", json={"api_version": "1.1.0"})
requests_mock.get("http://bar.test/", json={"api_version": "1.1.0"})

Expand Down Expand Up @@ -704,7 +704,8 @@ def test_automatic_cancel_of_too_long_running_jobs(

def test_empty_csv_handling(self, tmp_path, requests_mock, sleep_mock, recwarn):
"""
Check how starting from an empty CSV is handled: will columns accepts string values without warning/error?
Check how starting from an empty CSV is handled:
will empty columns accepts string values without warning/error?
"""
manager = self._create_basic_mocked_manager(requests_mock, tmp_path)

Expand Down

0 comments on commit 8c1fcd4

Please sign in to comment.