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

Failing joins on field that is nullable in one table but not in the other #1193

Closed
j-chmielewski opened this issue Aug 2, 2015 · 0 comments · Fixed by #1218
Closed

Failing joins on field that is nullable in one table but not in the other #1193

j-chmielewski opened this issue Aug 2, 2015 · 0 comments · Fixed by #1218
Assignees
Milestone

Comments

@j-chmielewski
Copy link

Given following tables (postgresql db):

example> \d table1
+----------+---------+-------------+
| Column   | Type    | Modifiers   |
|----------+---------+-------------|
| id       | integer | not null    |
| field    | integer |             |
+----------+---------+-------------+
Indexes:
    "table1_pkey" PRIMARY KEY, btree (id)

example> \d table2
+----------+---------+-------------+
| Column   | Type    | Modifiers   |
|----------+---------+-------------|
| id       | integer | not null    |
| field    | integer | not null    |
+----------+---------+-------------+
Indexes:
    "table2_pkey" PRIMARY KEY, btree (id)

Following code fails:

join(table1, table2, 'field')

With this error message:

TypeError                                 Traceback (most recent call last)
<ipython-input-14-2a191a07eec9> in <module>()
----> 1 join(database.table1, database.table2, 'field')

/home/user/anaconda/envs/env/lib/python2.7/site-packages/blaze/expr/collections.pyc in join(lhs, rhs, on_left, on_right, how, suffixes)
    435                          (lhs, rhs))
    436     if types_of_fields(on_left, lhs) != types_of_fields(on_right, rhs):
--> 437         raise TypeError("Schema's of joining columns do not match")
    438     _on_left = tuple(on_left) if isinstance(on_left, list) else on_left
    439     _on_right = (tuple(on_right) if isinstance(on_right, list)

TypeError: Schema's of joining columns do not match

Types returned by types_of_fields function:

types_of_fields('field', database.table1) #  ?int32
types_of_fields('field', database.table2) #  ctype("int32")  
@cpcloud cpcloud added this to the 0.8.3 milestone Aug 2, 2015
@cpcloud cpcloud self-assigned this Aug 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants