Skip to content

Commit

Permalink
select_lt() respects empty arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
mezantrop committed Jun 28, 2024
1 parent 148ef10 commit 8987213
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 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.06.28 tSQLike-1.0.3**
* `select_lt()` respects empty arguments

* **2024.06.24 tSQLike-1.0.3**
* `write_json()` defaults to `export_f='export_list_dicts()'`
* `read_json()` implemented as a standalone function
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.0.3"
__version__ = "1.0.4"
9 changes: 7 additions & 2 deletions tsqlike/tsqlike.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,14 +621,19 @@ def select_lt(self, columns='*', where='', comp='==', val='', new_tname=''):

r_table = [[]]
r_columns = []
columns = self.header if columns == '*' else columns.split(',')
scol_idx = self.header.index(where)
columns = self.header if columns in ('*', '') else columns.split(',')

for column in self.header:
if column in columns:
r_table[0].append(column)
r_columns.append(self.header.index(column))

if not where or not comp or not val:
return Table(name=new_tname if new_tname else
self.name + TNAME_TNAME_DELIMITER + str(self.timestamp),
data=r_table + [[r[c] for c in r_columns] for r in self.table])

scol_idx = self.header.index(where)
return Table(name=new_tname if new_tname else
self.name + TNAME_TNAME_DELIMITER + str(self.timestamp),
data=r_table + [[r[c] for c in r_columns]
Expand Down

0 comments on commit 8987213

Please sign in to comment.