Skip to content

Commit

Permalink
Use another criterion to switch to simulation mode in stream2raw
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienPeloton committed Jan 29, 2025
1 parent c563e8b commit 719e577
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions bin/ztf/stream2raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,8 @@ def main():
alert_schema, _, alert_schema_json = get_schemas_from_avro(args.schema)

# Decode the Avro data, and keep only (timestamp, data)
if args.producer == "sims":
# using custom from_avro (not available for Spark 2.4.x)
# it will be available from Spark 3.0 though
if args.servers.startswith("localhost"):
# Only for test suite
df_decoded = df.select([
from_avro(df["value"], alert_schema_json).alias("decoded")
])
Expand Down

0 comments on commit 719e577

Please sign in to comment.