Skip to content

Commit

Permalink
Use ALIAS when selecting casted columns
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienPeloton committed Nov 20, 2023
1 parent de6a9f2 commit 048d87b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions bin/index_archival.py
Original file line number Diff line number Diff line change
Expand Up @@ -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<double>'),
F.col('prv_candidates.fid').cast('array<int>'),
F.col('prv_candidates.magpsf').cast('array<float>'),
F.col('prv_candidates.sigmapsf').cast('array<float>'),
F.col('prv_candidates.diffmaglim').cast('array<float>')
F.col('objectId').cast('string').alias('objectId'),
F.col('prv_candidates.jd').cast('array<double>').alias('jd'),
F.col('prv_candidates.fid').cast('array<int>').alias('fid'),
F.col('prv_candidates.magpsf').cast('array<float>').alias('magpsf'),
F.col('prv_candidates.sigmapsf').cast('array<float>').alias('sigmapsf'),
F.col('prv_candidates.diffmaglim').cast('array<float>').alias('diffmaglim')
)
else:
df = df_flat
Expand Down

0 comments on commit 048d87b

Please sign in to comment.