Skip to content

Commit

Permalink
tSQLike-1.1.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mezantrop committed Oct 25, 2024
1 parent b1af600 commit 0afcad1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# CHANGELOG

* **2024.10.24 tSQLike-1.1.7.1**
* `Table.join()` Speed up `FULL_JOIN` operations

* **2024.10.24 tSQLike-1.1.7**
* `Table.join()` `extend` replaces `append` lists method
* `Table.__repr__()` returns object representation to be unambiguous
Expand Down
2 changes: 1 addition & 1 deletion tsqlike/__about__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
""" Version number in a single place """

__version__ = "1.1.7"
__version__ = "1.1.7.1"
18 changes: 11 additions & 7 deletions tsqlike/tsqlike.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,18 +648,22 @@ def join(self, table, on='', mode=JOIN_INNER, name='', replace=False,
# Concatenate table headers as row[0] of the results table
r_table.append(self.header + table.header)

# Inner JOIN
for c_tl, tl in enumerate(self.table):
for c_tr, tr in enumerate(table.table):
if efunc(tl, tr):
r_table.append(tl + tr)
tl_match.append(c_tl)
tr_match.append(c_tr)
if mode in (JOIN_LEFT, JOIN_FULL):
if mode == JOIN_FULL:
r_table.extend([tl + tr])
else:
# Inner JOIN
if efunc(tl, tr):
r_table.extend([tl + tr])
tl_match.append(c_tl)
tr_match.append(c_tr)

if mode == JOIN_LEFT:
for it in range(0, self.rows):
if it not in tl_match:
r_table.extend([self.table[it] + [None] * table.cols])
if mode in (JOIN_RIGHT, JOIN_FULL):
if mode == JOIN_RIGHT:
for it in range(0, table.rows):
if it not in tr_match:
r_table.extend([[None] * self.cols + table.table[it]])
Expand Down

0 comments on commit 0afcad1

Please sign in to comment.