Skip to content

Commit

Permalink
timestamp fix?
Browse files Browse the repository at this point in the history
  • Loading branch information
robotastic committed Jan 30, 2025
1 parent 70cd2fc commit b314c3f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions skyscan-c2/c2_pub_sub.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,11 +418,11 @@ def _add_faa_info(self, object_ledger_df: pd.DataFrame) -> pd.DataFrame:
reg_matching_rows = self.faa_master_df.loc[object_ledger_df.name.upper()]
except KeyError as e:
logging.debug(f"Aircraft not found in FAA data: {e} ")
return
return object_ledger_df
except IndexError as e:
logging.info("indexerror")
logging.info(e)
return
return object_ledger_df
except Exception as e:
logging.info(f"random error {e}")
#logging.info(object_ledger_df.name.upper())
Expand Down Expand Up @@ -491,6 +491,10 @@ def _target_selection_callback(

if len(object_ledger_df):
object_ledger_df = object_ledger_df.apply(lambda x: self._add_faa_info(x), axis=1)
# Check and log any rows missing a timestamp
missing_timestamp_rows = object_ledger_df[~object_ledger_df['timestamp'].notna()]
if not missing_timestamp_rows.empty:
logging.warning(f"Rows missing timestamp: {missing_timestamp_rows}")
### some logic to select which target
object_ledger_df["age"] = time() - object_ledger_df["timestamp"]
object_ledger_df["target"] = False
Expand Down

0 comments on commit b314c3f

Please sign in to comment.