Skip to content

Commit 29d9b16

Browse files
committed
Issue #680 move read() from JobDatabaseInterface to FullDataFrameJobDatabase
1 parent cadf61d commit 29d9b16

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919
this is not translated automatically anymore to deprecated, non-standard `read_vector` usage.
2020
Instead, if it is a local GeoJSON file, the GeoJSON data will be loaded directly client-side.
2121
([#104](https://github.com/Open-EO/openeo-python-client/issues/104), [#457](https://github.com/Open-EO/openeo-python-client/issues/457))
22+
- Move `read()` method from general `JobDatabaseInterface` to more specific `FullDataFrameJobDatabase` ([#680](https://github.com/Open-EO/openeo-python-client/issues/680))
2223

2324
### Removed
2425

openeo/extra/job_management.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,6 @@ def exists(self) -> bool:
7070
"""Does the job database already exist, to read job data from?"""
7171
...
7272

73-
@abc.abstractmethod
74-
def read(self) -> pd.DataFrame:
75-
"""
76-
Read job data from the database as pandas DataFrame.
77-
78-
:return: loaded job data.
79-
"""
80-
...
81-
8273
@abc.abstractmethod
8374
def persist(self, df: pd.DataFrame):
8475
"""
@@ -364,7 +355,6 @@ def start_job_thread(self, start_job: Callable[[], BatchJob], job_db: JobDatabas
364355

365356
# Resume from existing db
366357
_log.info(f"Resuming `run_jobs` from existing {job_db}")
367-
df = job_db.read()
368358

369359
self._stop_thread = False
370360
def run_loop():
@@ -810,6 +800,15 @@ def initialize_from_df(self, df: pd.DataFrame, *, on_exists: str = "error"):
810800
# Return self to allow chaining with constructor.
811801
return self
812802

803+
@abc.abstractmethod
804+
def read(self) -> pd.DataFrame:
805+
"""
806+
Read job data from the database as pandas DataFrame.
807+
808+
:return: loaded job data.
809+
"""
810+
...
811+
813812
@property
814813
def df(self) -> pd.DataFrame:
815814
if self._df is None:

0 commit comments

Comments
 (0)