Skip to content

Docs: CFT dataset_id is the Dataset Name; README reads expiresIn (TD-9692) - #70

Open
kyorkJ1 wants to merge 1 commit into
mainfrom
fix/TD-9692-cft-dataset-docs
Open

kyorkJ1 wants to merge 1 commit into
mainfrom
fix/TD-9692-cft-dataset-docs

Conversation

@kyorkJ1

@kyorkJ1 kyorkJ1 commented Nov 24, 2026

Copy link
Copy Markdown

+90 −14

Fixes TD-9692. A customer's Custom File Transfer upload failed because dataset_id was documented as an opaque "dataset ID". The upload-URL resolver issues a URL only when datasetId exactly matches a config.entities[].id, which is the Dataset Name set on the CFT instance. The fix is docs and examples, plus a README snippet that read the wrong response key.

What changed

  • jupiterone/client.py: docstrings of get_cft_upload_url and upload_cft_file only. dataset_id is the Dataset Name, matched exactly, with how to list valid names via get_integration_instance_details. The GraphQL string, variables and return line are byte-identical.
  • examples/09_custom_file_transfer_example.py: help text, labels and placeholder describe J1_CFT_DATASET_ID as the Dataset Name (example EuropaUsers). The env var name is unchanged.
  • README.md: CFT section explains the exact match, shows the lookup, and reads upload_info['expiresIn']. The old expiresAt key raised KeyError because the mutation selects uploadUrl and expiresIn.
  • tests/test_cft_methods.py: fixture returns expiresIn as the real API does.
  • tests/test_cft_docs.py (new): reads the mutation's selection set from the real query string, finds every upload_info['<key>'] read in README, examples/ and jupiterone/, and fails if any key is not selected. Also asserts the get_cft_upload_url docstring names "Dataset Name" and get_integration_instance_details.

LOC summary

Category Files +/−
Source (docstrings only) jupiterone/client.py +8 −4
Examples examples/09_custom_file_transfer_example.py +6 −6
Docs README.md +10 −3
Tests (new regression test) tests/test_cft_docs.py +65 −0
Tests (fixture) tests/test_cft_methods.py +1 −1

Verification

  • Red-check: on the origin/main files, tests/test_cft_docs.py fails 3 of 4 (README expiresAt key, both docstring assertions). On this branch all 4 pass.
  • pytest -k cft: 18 passed.
  • Full suite with --ignore=tests/test_deferred_response.py --ignore=tests/test_query.py: 27 failed, 217 passed. The failing set is identical to the origin/main baseline (27 pre-existing failures outside CFT, e.g. test_syncapi_request, test_list_questions). None are new.
  • python -m py_compile examples/09_custom_file_transfer_example.py passes.
  • AST check: jupiterone/client.py with docstrings stripped matches origin/main.
  • Independent review (kj-review, read-only): verdict pass, no must-fix findings. Report at the run folder TD-9692-review-r1.md.

Not verified

  • The lookup path ["data"]["integrationInstance"]["config"]["entities"] was checked against the integration service source, not against a live CFT instance.

Nits left (not blocking)

  • The lookup snippet indexes config['entities'] directly, so it raises on an instance with no entities. .get('entities', []) would be gentler.
  • The test_cft_docs.py selection-set regex would mis-tokenise a future nested selection. Not an issue for the current flat selection.
  • The fixture's dataset_id is still ID-shaped, and expiresIn: 900 differs from the server's 60 seconds. Test data only.

Out of scope

  • Server error message in jupiter-integration-service (does not list valid dataset names).
  • docs-v2 pages (python-client.md, custom-file-transfer.md), a follow-up PR in that repo.

🤖 Generated with Claude Code

…9692)

Customers were sending the wrong dataset_id because the Python client,
example 09 and the README described it as an opaque "dataset ID" with
placeholder values. The upload-URL resolver only issues a URL when
datasetId exactly matches a config.entities[].id, which is the Dataset
Name set on the CFT instance.

- get_cft_upload_url / upload_cft_file docstrings: dataset_id is the
  Dataset Name, matched exactly; how to list valid names via
  get_integration_instance_details.
- examples/09: help text, labels and placeholder use Dataset Name.
- README: CFT section explains the exact match, shows the lookup, and
  reads upload_info['expiresIn'] (the mutation selects expiresIn, not
  expiresAt, so the old snippet raised KeyError).
- tests: fixture returns expiresIn; new test_cft_docs.py discovers
  every upload_info[...] read in README, examples and the package and
  fails if one is not selected by the mutation, and asserts the
  docstring terms.

No runtime behaviour change: the GraphQL string, variables and return
statement are byte-identical.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
@kyorkJ1
kyorkJ1 requested review from a team as code owners November 24, 2026 13:42
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.

1 participant