Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#1941)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 23.12.1 → 24.1.1](psf/black@23.12.1...24.1.1)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Keep GitHub Actions up to date with GitHub's Dependabot

* https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
* https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
  • Loading branch information
pre-commit-ci[bot] and cclauss committed Jan 30, 2024
1 parent f28139e commit ff96833
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 18 deletions.
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Keep GitHub Actions up to date with GitHub's Dependabot...
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem
version: 2
updates:
- package-ecosystem: github-actions
directory: /
groups:
github-actions:
patterns:
- "*" # Group all Actions updates into a single larger pull request
schedule:
interval: weekly
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.1.1
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down
8 changes: 5 additions & 3 deletions haystack/backends/elasticsearch_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,9 +677,11 @@ def _process_results(
if raw_suggest:
spelling_suggestion = " ".join(
[
word["text"]
if len(word["options"]) == 0
else word["options"][0]["text"]
(
word["text"]
if len(word["options"]) == 0
else word["options"][0]["text"]
)
for word in raw_suggest
]
)
Expand Down
1 change: 1 addition & 0 deletions haystack/backends/simple_backend.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
A very basic, ORM-based backend for simple search during tests.
"""

from functools import reduce
from warnings import warn

Expand Down
29 changes: 15 additions & 14 deletions haystack/backends/solr_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,33 +267,34 @@ def build_search_kwargs(

for facet_field, options in facets.items():
for key, value in options.items():
kwargs[
"f.%s.facet.%s" % (facet_field, key)
] = self.conn._from_python(value)
kwargs["f.%s.facet.%s" % (facet_field, key)] = (
self.conn._from_python(value)
)

if date_facets is not None:
kwargs["facet"] = "on"
kwargs["facet.%s" % self.date_facet_field] = date_facets.keys()
kwargs["facet.%s.other" % self.date_facet_field] = "none"

for key, value in date_facets.items():
kwargs[
"f.%s.facet.%s.start" % (key, self.date_facet_field)
] = self.conn._from_python(value.get("start_date"))
kwargs[
"f.%s.facet.%s.end" % (key, self.date_facet_field)
] = self.conn._from_python(value.get("end_date"))
kwargs["f.%s.facet.%s.start" % (key, self.date_facet_field)] = (
self.conn._from_python(value.get("start_date"))
)
kwargs["f.%s.facet.%s.end" % (key, self.date_facet_field)] = (
self.conn._from_python(value.get("end_date"))
)
gap_by_string = value.get("gap_by").upper()
gap_string = "%d%s" % (value.get("gap_amount"), gap_by_string)

if value.get("gap_amount") != 1:
gap_string += "S"

kwargs[
"f.%s.facet.%s.gap" % (key, self.date_facet_field)
] = "+%s/%s" % (
gap_string,
gap_by_string,
kwargs["f.%s.facet.%s.gap" % (key, self.date_facet_field)] = (
"+%s/%s"
% (
gap_string,
gap_by_string,
)
)

if query_facets is not None:
Expand Down
1 change: 1 addition & 0 deletions test_haystack/test_django_config_detection.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""""""

import unittest

import django
Expand Down
1 change: 1 addition & 0 deletions test_haystack/whoosh_tests/test_forms.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for Whoosh spelling suggestions"""

from django.conf import settings
from django.http import HttpRequest

Expand Down

0 comments on commit ff96833

Please sign in to comment.