MCPcopy Index your code
hub / github.com/pathwaycom/pathway / asof_join_outer

Function asof_join_outer

python/pathway/stdlib/temporal/_asof_join.py:1002–1109  ·  view source on GitHub ↗

Perform an outer ASOF join of two tables. Args: other: Table to join with self, both must contain a column `val` self_time, other_time: time-like column expression to do the join against on: a list of column expressions. Each must have == as the top level operation

(
    self: pw.Table,
    other: pw.Table,
    self_time: pw.ColumnExpression,
    other_time: pw.ColumnExpression,
    *on: pw.ColumnExpression,
    behavior: CommonBehavior | None = None,
    defaults: dict[pw.ColumnReference, Any] = {},
    direction: Direction = Direction.BACKWARD,
    left_instance: expr.ColumnReference | None = None,
    right_instance: expr.ColumnReference | None = None,
)

Source from the content-addressed store, hash-verified

1000@check_arg_types
1001@trace_user_frame
1002def asof_join_outer(
1003 self: pw.Table,
1004 other: pw.Table,
1005 self_time: pw.ColumnExpression,
1006 other_time: pw.ColumnExpression,
1007 *on: pw.ColumnExpression,
1008 behavior: CommonBehavior | None = None,
1009 defaults: dict[pw.ColumnReference, Any] = {},
1010 direction: Direction = Direction.BACKWARD,
1011 left_instance: expr.ColumnReference | None = None,
1012 right_instance: expr.ColumnReference | None = None,
1013):
1014 """Perform an outer ASOF join of two tables.
1015
1016 Args:
1017 other: Table to join with self, both must contain a column `val`
1018 self_time, other_time: time-like column expression to do the join against
1019 on: a list of column expressions. Each must have == as the top level operation
1020 and be of the form LHS: ColumnReference == RHS: ColumnReference.
1021 behavior: defines the temporal behavior of a join - features like delaying entries
1022 or ignoring late entries.
1023 defaults: dictionary column-> default value. Entries in the resulting table that
1024 not have a predecessor in the join will be set to this default value. If no
1025 default is provided, None will be used.
1026 direction: direction of the join, accepted values: Direction.BACKWARD,
1027 Direction.FORWARD, Direction.NEAREST
1028 left_instance/right_instance: optional arguments describing partitioning of the data into
1029 separate instances
1030
1031
1032 Example:
1033
1034 >>> import pathway as pw
1035 >>> t1 = pw.debug.table_from_markdown(
1036 ... '''
1037 ... | K | val | t
1038 ... 1 | 0 | 1 | 1
1039 ... 2 | 0 | 2 | 4
1040 ... 3 | 0 | 3 | 5
1041 ... 4 | 0 | 4 | 6
1042 ... 5 | 0 | 5 | 7
1043 ... 6 | 0 | 6 | 11
1044 ... 7 | 0 | 7 | 12
1045 ... 8 | 1 | 8 | 5
1046 ... 9 | 1 | 9 | 7
1047 ... '''
1048 ... )
1049 >>> t2 = pw.debug.table_from_markdown(
1050 ... '''
1051 ... | K | val | t
1052 ... 21 | 1 | 7 | 2
1053 ... 22 | 1 | 3 | 8
1054 ... 23 | 0 | 0 | 2
1055 ... 24 | 0 | 6 | 3
1056 ... 25 | 0 | 2 | 7
1057 ... 26 | 0 | 3 | 8
1058 ... 27 | 0 | 9 | 9
1059 ... 28 | 0 | 7 | 13

Callers

nothing calls this directly

Calls 1

_asof_joinFunction · 0.85

Tested by

no test coverage detected