diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d7b8ecfd..52298bd59 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,17 +8,32 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python 3.x - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.x" - name: Install dependencies run: | python3 -m pip install nox - name: Lint the code run: nox -s lint + package: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Set up Python 3.x + uses: actions/setup-python@v5 + with: + python-version: "3.11" + - name: Install dependencies + run: | + python3 -m pip install build + - name: Build dists + run: python utils/build-dists.py + test-linux: strategy: fail-fast: false @@ -32,9 +47,9 @@ jobs: continue-on-error: false steps: - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set Up Python - ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install Dependencies diff --git a/elasticsearch/_otel.py b/elasticsearch/_otel.py index 4bb57dae7..f37ca24cd 100644 --- a/elasticsearch/_otel.py +++ b/elasticsearch/_otel.py @@ -102,7 +102,7 @@ def helpers_span(self, span_name: str) -> Generator[OpenTelemetrySpan, None, Non @contextlib.contextmanager def use_span(self, span: OpenTelemetrySpan) -> Generator[None, None, None]: - if not self.enabled or self.tracer is None: + if not self.enabled or self.tracer is None or span.otel_span is None: yield return diff --git a/elasticsearch/_sync/client/utils.py b/elasticsearch/_sync/client/utils.py index 959f61bfd..c5ec21dae 100644 --- a/elasticsearch/_sync/client/utils.py +++ b/elasticsearch/_sync/client/utils.py @@ -56,10 +56,9 @@ url_to_node_config, ) -from elasticsearch.exceptions import GeneralAvailabilityWarning - from ..._version import __versionstr__ from ...compat import to_bytes, to_str, warn_stacklevel +from ...exceptions import GeneralAvailabilityWarning if TYPE_CHECKING: from ._base import NamespacedClient