Skip to content

Commit 3ffcf3e

Browse files
include initialize_from_df in JobDatabaseInterface
1 parent 3f8e3c3 commit 3ffcf3e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

openeo/extra/job_management.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,20 @@ def get_by_status(self, statuses: List[str], max=None) -> pd.DataFrame:
104104
"""
105105
...
106106

107+
@abc.abstractmethod
108+
def initialize_from_df(self, df: pd.DataFrame, on_exists: str = "error") -> "JobDatabaseInterface":
109+
"""
110+
Initialize the job database from a given dataframe,
111+
112+
:param df: dataframe with some columns your ``start_job`` callable expects
113+
:param on_exists: what to do when the job database already exists:
114+
- "error": (default) raise an exception
115+
- "skip": work with existing database, ignore given dataframe and skip any initialization
116+
117+
:return: initialized job database.
118+
"""
119+
...
120+
107121

108122
def _start_job_default(row: pd.Series, connection: Connection, *args, **kwargs):
109123
raise NotImplementedError("No 'start_job' callable provided")

0 commit comments

Comments
 (0)