Skip to content

Add layer components and source credentials support - #35

Merged
binaryseed merged 3 commits into
mainfrom
claude/felt-python-api-audit-drliyu
Aug 5, 2026
Merged

Add layer components and source credentials support#35
binaryseed merged 3 commits into
mainfrom
claude/felt-python-api-audit-drliyu

Conversation

@samhashemi

@samhashemi samhashemi commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

An audit of this client against the Felt REST API v2 OpenAPI spec found that 49 of 57 endpoints were covered. This PR adds the 8 missing endpoints and fixes parameter drift in existing functions, bumping the version to 0.2.0.

New: Layer components (felt_python/components.py)

The layer components endpoints had no client coverage:

  • list_layer_components(map_id, layer_id)
  • create_layer_component(map_id, layer_id, component_type, data, title=None, config=None)
  • get_layer_component(map_id, layer_id, component_id)
  • update_layer_component(map_id, layer_id, component_id, data=None, title=None, config=None)
  • delete_layer_component(map_id, layer_id, component_id)

All five component types are supported (statistic, histogram, bar_chart, time_series, filter) — they share the same top-level shape in the API, so a single set of functions covers them with data/config passed as dicts.

New: Source credentials (felt_python/sources.py)

  • create_source_credential(source_id, name, use_case, credential)
  • update_source_credential(source_id, credential_id, name=None, use_case=None, credential=None)
  • delete_source_credential(source_id, credential_id)

The credential dict supports all documented types (aws_assume_role, azure_storage_connection_string, custom_headers, gcp_service_account_json, key_pair, snowflake_pat), listed in the docstring.

Parameter drift fixes in existing functions

  • update_layer_group: adds subtitle and legend_visibility parameters; documents the newer select and multi_select options for visibility_interaction
  • update_layer_groups: documents the subtitle, legend_visibility and visibility_interaction keys
  • update_layers: documents the subtitle, layer_group_id, legend_display and legend_visibility keys
  • create_custom_export: documents the geotiff, pmtiles, shapefile, kml and geoparquet output formats (docstring previously listed only csv/gpkg/geojson)

Tests

  • New tests/components_test.py E2E test following the existing pattern: creates a map, uploads a fixture layer, then exercises create/list/get/update/delete on a statistic component; registered in tests/tests.py
  • Source credential functions have no E2E test since they require real cloud credentials
  • Verified locally: ruff check, ruff format --check, and mypy all pass on the changed files (the pre-existing certifi import error in api.py is environmental and untouched); all new symbols import and are in __all__

samhashemi and others added 2 commits August 5, 2026 16:07
Audit of the client against the Felt REST API v2 OpenAPI spec found two
endpoint groups with no coverage, plus some parameter drift in existing
functions.

New: layer components (felt_python/components.py)
- list_layer_components, create_layer_component, get_layer_component,
  update_layer_component, delete_layer_component
- Supports all component types: statistic, histogram, bar_chart,
  time_series, filter

New: source credentials (felt_python/sources.py)
- create_source_credential, update_source_credential,
  delete_source_credential

Updated for API drift:
- update_layer_group: add subtitle and legend_visibility parameters;
  document the select/multi_select visibility_interaction options
- update_layer_groups: document subtitle, legend_visibility and
  visibility_interaction keys
- update_layers: document subtitle, layer_group_id, legend_display and
  legend_visibility keys
- create_custom_export: document the geotiff, pmtiles, shapefile, kml
  and geoparquet output formats

Adds an E2E test for layer components and bumps the version to 0.2.0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0123e8yxTXGb3tJjwHaaBZaK
CI installs the latest ruff on every run, and ruff 0.16 widened the
default rule selection (import sorting, datetime timezone checks, blind
except, __all__ sorting), which flags 41 pre-existing violations on main
and turns lint red for every branch. Pin the selected rules to the
previous defaults so lint results are deterministic across ruff
releases.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0123e8yxTXGb3tJjwHaaBZaK
The custom_headers credential example was missing the required
"sensitive" field on header entries; document its redaction behavior.
Also note the 256-character limit on component titles, which lives in
the backend changeset rather than the OpenAPI schema.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0123e8yxTXGb3tJjwHaaBZaK
@samhashemi
samhashemi marked this pull request as ready for review August 5, 2026 23:10

@binaryseed binaryseed left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

@binaryseed
binaryseed merged commit 777b97b into main Aug 5, 2026
2 checks passed
@binaryseed
binaryseed deleted the claude/felt-python-api-audit-drliyu branch August 5, 2026 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants