def _build_gremlin_properties()

in awswrangler/neptune/_utils.py [0:0]


def _build_gremlin_properties(g: GraphTraversalSource, row: Any) -> GraphTraversalSource:
    for column, value in row.items():
        if column not in ["~id", "~label", "~to", "~from"]:
            if isinstance(value, list) and len(value) > 0:
                for item in value:
                    g = g.property(Cardinality.set_, column, item)
            elif not pd.isna(value) and not pd.isnull(value):
                g = g.property(column, value)
    return g