Skip to content

_fetch_payload_pending_batch()

Class: JobsAustriaCacheSynchronizer
File: jobs_austria_cache_synchronizer.py · line 51

Rows linked to a job but whose job is missing location_id — need synchronize_company_id.

Signature

Parameters none
Returns not annotated
Async No
Visibility Private

Implementation

def _fetch_payload_pending_batch(self) -> pd.DataFrame:
    """Rows linked to a job but whose job is missing location_id — need synchronize_company_id."""
    query = (
        "SELECT sc.id AS scrape_cache_id, sc.url_hash, sc.data_payload, sc.fk_job_id AS jobs_id "
        "FROM scrape_cache sc "
        "JOIN jobs j ON j.id = sc.fk_job_id "
        f"WHERE j.location_id IS NULL LIMIT {BATCH_SIZE}"
    )
    with self.engine.connect() as conn:
        return pd.read_sql(query, conn)