Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-35301

Extend dax_obscore extra_columns facility to support value templating

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: dax_obscore
    • Labels:
    • Sprint:
      DB_F22_6
    • Team:
      Data Access and Database
    • Urgent?:
      No

      Description

      For DP0.2, we need to create some additional columns during extraction, and populate them with values based on DataId attribute values.  The dax_osbcore configuration facility already supports creation of new columns, but only constant data for these new columns is supported.  This ticker requests extending the new columns facility to support value templating similar to what is already supported elsewhere in the configuration.

      Colin Slater could probably comment here on specific columns and DataIds needed for DP0.2.  See also DM-34685.

        Attachments

          Issue Links

            Activity

            Hide
            ctslater Colin Slater added a comment -

            My proposal is to add extra_columns for: visit, detector, tract, patch, band, filter, and to prefix each of these column names with "lsst_".

             

            Show
            ctslater Colin Slater added a comment - My proposal is to add extra_columns for: visit, detector, tract, patch, band, filter, and to prefix each of these column names with "lsst_".  
            Hide
            salnikov Andy Salnikov added a comment -

            One interesting issue is that the result of template expansion is a string (it just uses plain Python format() method). I can imagine that for some columns it may be important to use natural type when exporting to CSV/Parquet, e.g. int or float. I probably need something slightly more complicated when specifying this type of template columns. I'll try to think of something that is not too complex.

            Show
            salnikov Andy Salnikov added a comment - One interesting issue is that the result of template expansion is a string (it just uses plain Python format() method). I can imagine that for some columns it may be important to use natural type when exporting to CSV/Parquet, e.g. int or float. I probably need something slightly more complicated when specifying this type of template columns. I'll try to think of something that is not too complex.
            Hide
            fritzm Fritz Mueller added a comment -

            LGTM; K-T took a look as well

            Show
            fritzm Fritz Mueller added a comment - LGTM; K-T took a look as well
            Hide
            salnikov Andy Salnikov added a comment - - edited

            Merged, thanks for reviews!

            To test it I used this addition to a config file:

            extra_columns:
              lsst_visit:
                template: "{visit}"
                type: "int"
              lsst_detector:
                template: "{detector}"
                type: "int"
              lsst_tract:
                template: "{tract}"
                type: "int"
              lsst_patch:
                template: "{patch}"
                type: "int"
              lsst_band:
                template: "{band}"
                type: "str"
              lsst_filter:
                template: "{physical_filter}"
                type: "str"
            

            Which covers what Colin suggested in the comment above.

            Show
            salnikov Andy Salnikov added a comment - - edited Merged, thanks for reviews! To test it I used this addition to a config file: extra_columns: lsst_visit: template: "{visit}" type: "int" lsst_detector: template: "{detector}" type: "int" lsst_tract: template: "{tract}" type: "int" lsst_patch: template: "{patch}" type: "int" lsst_band: template: "{band}" type: "str" lsst_filter: template: "{physical_filter}" type: "str" Which covers what Colin suggested in the comment above.

              People

              Assignee:
              salnikov Andy Salnikov
              Reporter:
              fritzm Fritz Mueller
              Reviewers:
              Fritz Mueller
              Watchers:
              Andy Salnikov, Colin Slater, Fritz Mueller, Frossie Economou, Tim Jenness
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.