Skip to content

Commit

Permalink
pep8 requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
FusRoman committed Jan 10, 2023
1 parent 18aa914 commit 55dda75
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions fink_grb/offline/spark_offline.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def spark_offline(
.option("hbase.spark.use.hbasecontext", False)
.option("hbase.spark.pushdown.columnfilter", with_columns_filter)
.load()
.filter(~col("jd_objectId").startswith('schema_'))
.filter(~col("jd_objectId").startswith("schema_"))
)

ztf_alert = ztf_alert.select(
Expand Down Expand Up @@ -324,7 +324,9 @@ def launch_offline_mode(arguments, is_test=False):
fink_home = os.environ["FINK_HOME"]
hbase_catalog = fink_home + "/catalogs_hbase/ztf.jd.json"
except Exception as e:
logger.error("FINK_HOME environment variable not found \n\t {}".format(e))
logger.error(
"FINK_HOME environment variable not found \n\t {}".format(e)
)

time_window = int(config["OFFLINE"]["time_window"])
except Exception as e: # pragma: no cover
Expand Down Expand Up @@ -352,8 +354,9 @@ def launch_offline_mode(arguments, is_test=False):
spark_jars = config["STREAM"]["jars"]
if is_test:
fink_home = os.environ["FINK_HOME"]
spark_jars = "{}/libs/fink-broker_2.11-1.2.jar,{}/libs/hbase-spark-hbase2.2_spark3_scala2.11_hadoop2.7.jar,{}/libs/hbase-spark-protocol-shaded-hbase2.2_spark3_scala2.11_hadoop2.7.jar".format(fink_home, fink_home, fink_home)

spark_jars = "{}/libs/fink-broker_2.11-1.2.jar,{}/libs/hbase-spark-hbase2.2_spark3_scala2.11_hadoop2.7.jar,{}/libs/hbase-spark-protocol-shaded-hbase2.2_spark3_scala2.11_hadoop2.7.jar".format(
fink_home, fink_home, fink_home
)

except Exception as e:
if verbose:
Expand Down Expand Up @@ -472,5 +475,11 @@ def launch_offline_mode(arguments, is_test=False):
column_filter = True if sys.argv[8] == "True" else False

spark_offline(
hbase_catalog, gcn_datapath_prefix, grb_datapath_prefix, night, start_window, time_window, with_columns_filter=column_filter
hbase_catalog,
gcn_datapath_prefix,
grb_datapath_prefix,
night,
start_window,
time_window,
with_columns_filter=column_filter,
)

0 comments on commit 55dda75

Please sign in to comment.