Skip to content

Commit

Permalink
Issue #680 move read() from JobDatabaseInterface to `FullDataFram…
Browse files Browse the repository at this point in the history
…eJobDatabase`
  • Loading branch information
soxofaan committed Dec 6, 2024
1 parent cadf61d commit 29d9b16
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
this is not translated automatically anymore to deprecated, non-standard `read_vector` usage.
Instead, if it is a local GeoJSON file, the GeoJSON data will be loaded directly client-side.
([#104](https://github.com/Open-EO/openeo-python-client/issues/104), [#457](https://github.com/Open-EO/openeo-python-client/issues/457))
- Move `read()` method from general `JobDatabaseInterface` to more specific `FullDataFrameJobDatabase` ([#680](https://github.com/Open-EO/openeo-python-client/issues/680))

### Removed

Expand Down
19 changes: 9 additions & 10 deletions openeo/extra/job_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,6 @@ def exists(self) -> bool:
"""Does the job database already exist, to read job data from?"""
...

@abc.abstractmethod
def read(self) -> pd.DataFrame:
"""
Read job data from the database as pandas DataFrame.
:return: loaded job data.
"""
...

@abc.abstractmethod
def persist(self, df: pd.DataFrame):
"""
Expand Down Expand Up @@ -364,7 +355,6 @@ def start_job_thread(self, start_job: Callable[[], BatchJob], job_db: JobDatabas

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

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

@abc.abstractmethod
def read(self) -> pd.DataFrame:
"""
Read job data from the database as pandas DataFrame.
:return: loaded job data.
"""
...

@property
def df(self) -> pd.DataFrame:
if self._df is None:
Expand Down

0 comments on commit 29d9b16

Please sign in to comment.