Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Join on row number with mode full-outer #143

Open
cschloer opened this issue Jun 17, 2020 · 0 comments
Open

Join on row number with mode full-outer #143

cschloer opened this issue Jun 17, 2020 · 0 comments

Comments

@cschloer
Copy link
Contributor

Not sure if this intentional but if you join on a row number with mode full-outer it create a column called '#' with None as the value.

from dataflows import Flow, join

data1 = [
    {"col1": 1},
    {"col1": 2},
    {"col1": 3},
]
data2 = [
    {"col2": 1},
    {"col2": 2},
    {"col2": 3},
]


def test_join():
    flows = [
        data2,
        data1,
        join(
            "res_1",
            "{#}",
            "res_2",
            "{#}",
            fields={"col2": {"name": "col2"}},
            source_delete=True,
            mode="full-outer",
        ),
    ]
    rows, datapackage, _ = Flow(*flows).results()
    print(rows)
    assert rows == [
        [{"col1": 1, "col2": 1}, {"col1": 2, "col2": 2}, {"col1": 3, "col2": 3}]
    ]
[[{'col1': 1, '#': None, 'col2': 1}, {'col1': 2, '#': None, 'col2': 2}, {'col1': 3, '#': None, 'col2': 3}]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant