Skip to content

Mapping

Source code in docs_src/capo_glue/types/mapping.py
class Mapping(TypedDict, closed=True):
    to_key: NotRequired[
        "capo_glue.types.enclosed_in_string_property.EnclosedInStringProperty"
    ]
    """<p>After the apply mapping, what the name of the column should be. Can be the same as <code>FromPath</code>.</p>"""
    from_path: NotRequired[
        "capo_glue.types.enclosed_in_string_properties.EnclosedInStringProperties"
    ]
    """<p>The table or column to be modified.</p>"""
    from_type: NotRequired[
        "capo_glue.types.enclosed_in_string_property.EnclosedInStringProperty"
    ]
    """<p>The type of the data to be modified.</p>"""
    to_type: NotRequired[
        "capo_glue.types.enclosed_in_string_property.EnclosedInStringProperty"
    ]
    """<p>The data type that the data is to be modified to.</p>"""
    dropped: NotRequired["capo_glue.types.boxed_boolean.BoxedBoolean"]
    """<p>If true, then the column is removed.</p>"""
    children: NotRequired["capo_glue.types.mappings.Mappings"]
    """<p>Only applicable to nested data structures. If you want to change the parent structure, but also one of its children, you can fill out this data strucutre. It is also <code>Mapping</code>, but its <code>FromPath</code> will be the parent's <code>FromPath</code> plus the <code>FromPath</code> from this structure.</p> <p>For the children part, suppose you have the structure:</p> <p> <code>{ "FromPath": "OuterStructure", "ToKey": "OuterStructure", "ToType": "Struct", "Dropped": false, "Chidlren": [{ "FromPath": "inner", "ToKey": "inner", "ToType": "Double", "Dropped": false, }] }</code> </p> <p>You can specify a <code>Mapping</code> that looks like:</p> <p> <code>{ "FromPath": "OuterStructure", "ToKey": "OuterStructure", "ToType": "Struct", "Dropped": false, "Chidlren": [{ "FromPath": "inner", "ToKey": "inner", "ToType": "Double", "Dropped": false, }] }</code> </p>"""

children instance-attribute

children: NotRequired[Mappings]

Only applicable to nested data structures. If you want to change the parent structure, but also one of its children, you can fill out this data strucutre. It is also Mapping, but its FromPath will be the parent's FromPath plus the FromPath from this structure.

For the children part, suppose you have the structure:

{ "FromPath": "OuterStructure", "ToKey": "OuterStructure", "ToType": "Struct", "Dropped": false, "Chidlren": [{ "FromPath": "inner", "ToKey": "inner", "ToType": "Double", "Dropped": false, }] }

You can specify a Mapping that looks like:

{ "FromPath": "OuterStructure", "ToKey": "OuterStructure", "ToType": "Struct", "Dropped": false, "Chidlren": [{ "FromPath": "inner", "ToKey": "inner", "ToType": "Double", "Dropped": false, }] }

dropped instance-attribute

dropped: NotRequired[BoxedBoolean]

If true, then the column is removed.

from_path instance-attribute

from_path: NotRequired[EnclosedInStringProperties]

The table or column to be modified.

from_type instance-attribute

from_type: NotRequired[EnclosedInStringProperty]

The type of the data to be modified.

to_key instance-attribute

to_key: NotRequired[EnclosedInStringProperty]

After the apply mapping, what the name of the column should be. Can be the same as FromPath.

to_type instance-attribute

to_type: NotRequired[EnclosedInStringProperty]

The data type that the data is to be modified to.