Skip to content

Commit

Permalink
chore(deps-dev): bump black from 23.12.1 to 24.3.0 (#484)
Browse files Browse the repository at this point in the history
* chore(deps-dev): bump black from 23.12.1 to 24.3.0

Bumps [black](https://github.com/psf/black) from 23.12.1 to 24.3.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](psf/black@23.12.1...24.3.0)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix: apply new black style

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ted Conbeer <[email protected]>
  • Loading branch information
dependabot[bot] and tconbeer authored Mar 29, 2024
1 parent d2cb42a commit b16da50
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 23.11.0
rev: 24.3.0
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
Expand Down
48 changes: 24 additions & 24 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ harlequin-odbc = "^0.1.1"
pyinstrument = "^4.6.2"

[tool.poetry.group.static.dependencies]
black = "^23.3.0"
black = ">=23.3,<25.0"
ruff = ">=0.0.285"
mypy = "^1.2.0"
types-pygments = "^2.16.0.0"
Expand Down
8 changes: 5 additions & 3 deletions src/harlequin/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,9 +585,11 @@ def action_export(self) -> None:
)
self.app.push_screen(
ExportScreen(
formats=WINDOWS_COPY_FORMATS
if sys.platform == "win32"
else HARLEQUIN_COPY_FORMATS,
formats=(
WINDOWS_COPY_FORMATS
if sys.platform == "win32"
else HARLEQUIN_COPY_FORMATS
),
id="export_screen",
),
callback,
Expand Down
1 change: 1 addition & 0 deletions src/harlequin/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
cache.py was renamed to editor_cache.py when the Data Catalog cache was created.
"""

from harlequin.editor_cache import BufferState, Cache

__all__ = ["BufferState", "Cache"]
6 changes: 3 additions & 3 deletions src/harlequin/config_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ def _prompt_for_path(config_path: Path | None) -> tuple[Path, bool]:
raw_path: str = questionary.path(
"What config file do you want to create or update?",
default=str(existing) if existing is not None else ".harlequin.toml",
validate=lambda p: True
if p.endswith(".toml")
else "Must have a .toml extension",
validate=lambda p: (
True if p.endswith(".toml") else "Must have a .toml extension"
),
style=HARLEQUIN_QUESTIONARY_STYLE,
).unsafe_ask()
path = Path(raw_path).expanduser().resolve()
Expand Down
3 changes: 1 addition & 2 deletions src/harlequin/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@


class ExporterCallable(Protocol):
def __call__(self, table: ResultsTable, dest_path: str, **kwargs: Any) -> None:
...
def __call__(self, table: ResultsTable, dest_path: str, **kwargs: Any) -> None: ...


def copy(
Expand Down
22 changes: 13 additions & 9 deletions src/harlequin/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,11 @@ def _q_validator(raw: str) -> bool | str | None:

return questionary.text(
message=self.name,
default=safe_existing_value
if safe_existing_value is not None
else self.default or "",
default=(
safe_existing_value
if safe_existing_value is not None
else self.default or ""
),
validate=_q_validator,
style=HARLEQUIN_QUESTIONARY_STYLE,
)
Expand Down Expand Up @@ -429,9 +431,11 @@ def _path_validator(raw_path: str) -> bool | str:

return questionary.path(
message=self.name,
default=safe_existing_value
if safe_existing_value is not None
else self.default or "",
default=(
safe_existing_value
if safe_existing_value is not None
else self.default or ""
),
only_directories=not self.file_okay,
validate=_path_validator,
style=HARLEQUIN_QUESTIONARY_STYLE,
Expand Down Expand Up @@ -520,9 +524,9 @@ def to_questionary(self, existing_value: Any | None = None) -> questionary.Quest
return questionary.select(
message=self.name,
choices=self._flat_choices(),
default=safe_existing_value
if safe_existing_value is not None
else self.default,
default=(
safe_existing_value if safe_existing_value is not None else self.default
),
style=HARLEQUIN_QUESTIONARY_STYLE,
)

Expand Down
5 changes: 3 additions & 2 deletions src/harlequin_sqlite/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,9 @@ def __init__(
connection_mode: Literal["ro", "rw", "rwc", "memory"] | None = None,
timeout: str | float = 5.0,
detect_types: str | int = 0,
isolation_level: Literal["DEFERRED", "EXCLUSIVE", "IMMEDIATE"]
| None = "DEFERRED",
isolation_level: (
Literal["DEFERRED", "EXCLUSIVE", "IMMEDIATE"] | None
) = "DEFERRED",
cached_statements: str | int = 128,
**_: Any,
) -> None:
Expand Down
8 changes: 5 additions & 3 deletions stubs/pyarrow/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,11 @@ def nulls(
memory_pool: MemoryPool | None = None,
) -> Array: ...
def table(
data: pd.DataFrame
| Mapping[str, _PandasConvertible | list]
| list[_PandasConvertible],
data: (
pd.DataFrame
| Mapping[str, _PandasConvertible | list]
| list[_PandasConvertible]
),
names: list[str] | None = None,
schema: Schema | None = None,
metadata: Mapping | None = None,
Expand Down
8 changes: 5 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,11 @@ def _create_sqlite_db_from_data_dir(data_dir: Path, db_path: Path) -> None:
reader = csv.reader(f)
for row in reader:
quoted = [
val
if isinstance(val, (int, float))
else f"'{val.replace(SINGLE_QUOTE, DOUBLED_SINGLE_QUOTE)}'"
(
val
if isinstance(val, (int, float))
else f"'{val.replace(SINGLE_QUOTE, DOUBLED_SINGLE_QUOTE)}'"
)
for val in row
]
conn.execute(f"insert into {p.stem} values({', '.join(quoted)})")
Expand Down

0 comments on commit b16da50

Please sign in to comment.