From 048d87b9778ec5fb212c4957c748ac1d1bd085a8 Mon Sep 17 00:00:00 2001 From: JulienPeloton Date: Mon, 20 Nov 2023 22:33:32 +0100 Subject: [PATCH] Use ALIAS when selecting casted columns --- bin/index_archival.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/index_archival.py b/bin/index_archival.py index 59a3c7b3..5063c6b5 100644 --- a/bin/index_archival.py +++ b/bin/index_archival.py @@ -91,12 +91,12 @@ def main(): # Restrict the input DataFrame to the subset of wanted columns. if 'upper' in args.index_table: df = data.select( - F.col('objectId').cast('string'), - F.col('prv_candidates.jd').cast('array'), - F.col('prv_candidates.fid').cast('array'), - F.col('prv_candidates.magpsf').cast('array'), - F.col('prv_candidates.sigmapsf').cast('array'), - F.col('prv_candidates.diffmaglim').cast('array') + F.col('objectId').cast('string').alias('objectId'), + F.col('prv_candidates.jd').cast('array').alias('jd'), + F.col('prv_candidates.fid').cast('array').alias('fid'), + F.col('prv_candidates.magpsf').cast('array').alias('magpsf'), + F.col('prv_candidates.sigmapsf').cast('array').alias('sigmapsf'), + F.col('prv_candidates.diffmaglim').cast('array').alias('diffmaglim') ) else: df = df_flat