Skip to content

Commit

Permalink
V1.5.6 (#159)
Browse files Browse the repository at this point in the history
* fixes: use builtin func

* fixes: csv
  • Loading branch information
jlsneto authored Sep 6, 2021
1 parent c340495 commit 92c5069
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cereja/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
from . import experimental
from ._requests import request

VERSION = "1.5.5.final.0"
VERSION = "1.5.6.final.0"

__version__ = get_version_pep440_compliant(VERSION)

Expand Down
4 changes: 2 additions & 2 deletions cereja/file/_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ def __init__(self, *args, cols: Union[Tuple[str], List[str]] = (), fill_with=Non
self._str_to_literal = str_to_literal
self._fill_with = fill_with
self._n_values = 0
self._has_col = has_col or cols
self._has_col = has_col
super().__init__(*args, **kwargs)

@property
Expand Down Expand Up @@ -675,7 +675,7 @@ def parse(self, data: Union[Iterable[Iterable[Any]], str, int, float, complex],
if not is_sequence(data):
data = [data]
for row in data:
if not self._cols and self._has_col:
if not self._cols:
# set cols on first iter
self._cols = fill(value=list(row), max_size=len(row), with_=fill_with)
continue
Expand Down
6 changes: 3 additions & 3 deletions cereja/utils/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,10 @@ def list_methods(klass) -> List[str]:
return methods


def string_to_literal(val: str):
if isinstance(val, str):
def string_to_literal(val: Union[str, bytes]):
if isinstance(val, (str, bytes)):
try:
return ast.literal_eval(val)
return eval(val)
except:
pass
return val
Expand Down

0 comments on commit 92c5069

Please sign in to comment.