Skip to content

fix: Deprecated django tenant schema function replaced - #647

Merged
jaseemjaskp merged 1 commit into
mainfrom
fix/deprecated-function-replaced-django-tenant-schemas
Sep 20, 2024
Merged

fix: Deprecated django tenant schema function replaced#647
jaseemjaskp merged 1 commit into
mainfrom
fix/deprecated-function-replaced-django-tenant-schemas

Conversation

@chandrasekharan-zipstack

Copy link
Copy Markdown
Contributor

What

  • Replaced connection.get_tenant() with connection.tenant

Why

  • To address deprecation warning
    image

Can this PR break any existing features. If yes, please list possible items. If no, please explain why. (PS: Admins do not merge the PR without this section filled)

  • No, updated to method suggested by the library

Notes on Testing

  • No explicit testing done, able to run workflows / pipelines.

Checklist

I have read and understood the Contribution Guidelines.

@chandrasekharan-zipstack
chandrasekharan-zipstack requested review from kirtimanmishrazipstack and removed request for a team September 3, 2024 13:25
@github-actions

github-actions Bot commented Sep 3, 2024

Copy link
Copy Markdown
Contributor
filepath function $$\textcolor{#23d18b}{\tt{passed}}$$ SUBTOTAL
$$\textcolor{#23d18b}{\tt{worker/src/unstract/worker/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_logs}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{worker/src/unstract/worker/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_cleanup}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{worker/src/unstract/worker/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_cleanup\_skip}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{worker/src/unstract/worker/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_client\_init}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{worker/src/unstract/worker/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_image\_exists}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{worker/src/unstract/worker/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_image}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{worker/src/unstract/worker/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_container\_run\_config}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{worker/src/unstract/worker/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_container\_run\_config\_without\_mount}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{worker/src/unstract/worker/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_run\_container}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{TOTAL}}$$ $$\textcolor{#23d18b}{\tt{9}}$$ $$\textcolor{#23d18b}{\tt{9}}$$

@sonarqubecloud

sonarqubecloud Bot commented Sep 3, 2024

Copy link
Copy Markdown

@kirtimanmishrazipstack kirtimanmishrazipstack left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@muhammad-ali-e

Copy link
Copy Markdown
Contributor

@chandrasekharan-zipstack It might not be needed IF we rollout V2

@jaseemjaskp
jaseemjaskp merged commit c9bfbfd into main Sep 20, 2024
@jaseemjaskp
jaseemjaskp deleted the fix/deprecated-function-replaced-django-tenant-schemas branch September 20, 2024 08:56
pk-zipstack pushed a commit that referenced this pull request Aug 20, 2025
Replaced deprecated django tenant schema function
pk-zipstack added a commit that referenced this pull request Jul 27, 2026
Correctness / robustness:
- Return the real whisper_hash in extraction_metadata (was ''), and reject
  image mode + highlight explicitly instead of silently dropping highlights.
- Store page images under {extract_dir}/{stem}/pages (per-document), not the
  per-run hash — a re-extraction now overwrites its own pages instead of
  orphaning a fresh tree in FileStorage every run.
- persist_page_images cleans up already-written pages on a mid-list failure.
- Poll loop fails closed: only explicit intermediate states continue; a
  failure/unknown/empty status raises immediately instead of hanging to the
  budget. _safe_json logs non-JSON/non-object bodies.
- verify_page_count is now live: expected count derived locally from the input
  PDF (pdfplumber); extract asserts a contiguous 1..N page set (catches
  truncation + duplicate/misnamed members) and logs skipped entries.
- Retrieve advertises accept: application/zip; submit sends Content-Type.

Layering / guard (UNS-757):
- Promote OUTPUT_MODE/image/PDF_EXTENSION/PDF_ONLY_ERROR + an is_pdf() helper
  to the shared x2text.constants (ImageOutputConstants); backend imports the
  generic surface instead of the adapter's private src.
- Move the PDF-only guard into dynamic_extractor (the single extract choke
  point, under profile_manager) so all entry points and prompt-level profile
  overrides are covered; gate on the LLMWhisperer adapter id as well as
  output_mode so other x2text adapters can't inherit the rejection.

Comments: drop ticket-id/PR provenance and the contradictory PR#536/#647
contract notes; remove the unused IMAGE_MODE_LABEL 'single source of truth'.

Tests: fix the constants-reload cross-file pollution (retry tests now pin the
real budget on helper.WhispererDefaults); add network-layer coverage
(poll success/failure/non-JSON-fast-fail/budget, mid-stream download error +
close, submit-without-hash), mid-list cleanup, image+highlight rejection, a
non-LLMWhisperer no-op, and a dynamic_extractor call-site test. sdk1: 57 pass;
backend guard: 12 pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
pk-zipstack added a commit that referenced this pull request Jul 27, 2026
…omments

Follow-up to the review round: remove the contradictory 'ASSUMED contract
(PR #647)' vs 'verified against PR #536' notes and the 'decision 2A' / UNS-743
provenance from the adapter helper + constants comments, keeping the factual
one-line reason (comments carry the why, not the ticket).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants