Skip to content

Commit

Permalink
remove support for json
Browse files Browse the repository at this point in the history
- requires orjson which blocks pypy
- it's easy to export to json if required
- update pre-commit with full pylint path, which solves all issues
  • Loading branch information
gnzsnz committed May 27, 2024
1 parent 09e437f commit db62ab9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ repos:
rev: 24.4.2
hooks:
- id: black
# - repo: https://github.com/PyCQA/pylint
# rev: v3.1.0
# hooks:
# - id: pylint
# entry: pylint
# types: [python]
# args: ["-rn", # Only display messages
# "--rcfile=pyproject.toml", # Link to your config file
# ]
- repo: https://github.com/PyCQA/pylint
rev: v3.2.2
hooks:
- id: pylint
entry: pyenv which pylint
types: [python]
args: ["-rn", # Only display messages
"--rcfile=pyproject.toml", # Link to your config file
]
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
Expand Down
6 changes: 0 additions & 6 deletions ib_fundamental/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import re
from typing import Any, Optional

import orjson
from pandas import DataFrame

re_pattern = re.compile(r"(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])")
Expand All @@ -45,11 +44,6 @@ def to_dataframe(table: Any, key: Optional[str] = None) -> DataFrame:
return df


def to_json(obj: Any, **kwargs) -> bytes:
"""converts to JSON"""
return orjson.dumps(obj, **kwargs) # pylint: disable=no-member


def camel_to_snake(camel: str) -> str:
"""Convert CamelCase to snake_case"""
# https://stackoverflow.com/questions/1175208/elegant-python-function-to-convert-camelcase-to-snake-case
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ classifiers = [
dependencies = [
"ib_async>=1.0.1",
"pandas>=2.2.2",
"orjson>=3.10.3",
"defusedxml>=0.7.1",
]

Expand Down

0 comments on commit db62ab9

Please sign in to comment.