Add layer components and source credentials support - #35
Merged
Conversation
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
marked this pull request as ready for review
August 5, 2026 23:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 withdata/configpassed 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
credentialdict 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: addssubtitleandlegend_visibilityparameters; documents the newerselectandmulti_selectoptions forvisibility_interactionupdate_layer_groups: documents thesubtitle,legend_visibilityandvisibility_interactionkeysupdate_layers: documents thesubtitle,layer_group_id,legend_displayandlegend_visibilitykeyscreate_custom_export: documents thegeotiff,pmtiles,shapefile,kmlandgeoparquetoutput formats (docstring previously listed only csv/gpkg/geojson)Tests
tests/components_test.pyE2E test following the existing pattern: creates a map, uploads a fixture layer, then exercises create/list/get/update/delete on a statistic component; registered intests/tests.pyruff check,ruff format --check, andmypyall pass on the changed files (the pre-existingcertifiimport error inapi.pyis environmental and untouched); all new symbols import and are in__all__