Repository navigation
Conversation
… returns PUT /api/v1/continuous_queries/:id replaces the stored definition: Arc writes every column from the body, so a field the body omits is stored blank or zeroed. update() built a sparse payload from only the kwargs passed, and had no database, source_measurement or destination_measurement parameter at all, so it could not send a complete definition even in principle — against current Arc it answers 400 database is required (Basekick-Labs/arc#993, and #1011 adds the other five required fields). update() now reads the definition and sends it back with the arguments given applied, so a one-field change still carries a whole definition and preserves the five fields Arc overwrites without requiring: description, tag_columns, retention_days, delete_source_after_days and is_active. Omitting the last one set it false and silently stopped the continuous query. Two response shapes were also wrong, which is why the read half could not work: - create, get and update unwrapped data.get("query", data). Arc answers with the definition flat, and a flat definition has a query key holding SQL, so this passed a string where a mapping belongs and raised TypeError on all three. Replaced with ContinuousQuery.from_response, which unwraps only a mapping. - list read data.get("queries", []), but that endpoint answers with a bare array. Both forms are accepted now. The model was missing tag_columns, so a round trip through it dropped the metadata compaction uses to dedup continuous-query output (arc#521). Verified against a local Arc build: list, get, a one-field update and the async twin all round-trip, and the definition survives.
Member
Author
|
Basekick-Labs/arc#1228 makes |
This was referenced Oct 27, 2026
This branch has not been deployed
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.
Fixes #4. Draft on purpose — holding until Basekick-Labs/arc#1023 decides whether Arc keeps strict full-replace semantics on
PUTor grows a merge route. This fix is correct under either outcome (sending a complete definition always works), so it is ready whenever that lands; released with Arc 26.09.3.The break
PUT /api/v1/continuous_queries/:idreplaces the stored definition — Arc writes every column from the body, so a field the body omits is stored blank or zeroed.update()built a sparse payload from only the kwargs passed, and had nodatabase,source_measurementordestination_measurementparameter at all, so it could not send a complete definition even in principle. Against current Arc it answers400 database is required(Basekick-Labs/arc#993; Basekick-Labs/arc#1022 adds the other five required fields).update()now reads the definition and sends it back with the arguments given applied. A one-field change still carries a whole definition, and the five fields Arc overwrites without requiring are preserved:description,tag_columns,retention_days,delete_source_after_days,is_active. Omitting that last one storedfalseand silently stopped the continuous query.Two response shapes were wrong, which is why the read half could not work
Found while implementing the above —
update()cannot read-modify-write ifget()raises:create,getandupdateunwrappeddata.get("query", data). Arc answers with the definition flat, and a flat definition has aquerykey holding SQL — so this passed a string where a mapping belongs and raisedTypeError: argument after ** must be a mapping, not stron all three calls. NowContinuousQuery.from_response, which treatsqueryas an envelope only when it actually holds a mapping.listreaddata.get("queries", []), butGET /api/v1/continuous_queriesanswers with a bare array —'list' object has no attribute 'get'. Both forms accepted now.Also: the model was missing
tag_columns, so a round trip through it dropped the metadata compaction uses to dedup continuous-query output (Basekick-Labs/arc#521).Same change in the async twin.
Test plan
pytest tests/unit/— 109 pass (7 new: the full-definition body, the preserved fields, applying only what is given, both response shapes)ruff checkandruff format --checkclean;mypyreports nothing in the changed files (its 10 pre-existing errors are missing third-party stubs inquery/)list,get,update(is_active=False)then back toTrue, and the async twin withupdate(interval=...)— each round-trips and the definition survives (db1 cpu -> cpu_1hunchanged throughout)source_measurementis blank fails with Arc's own400 source_measurement is requiredrather than being silently re-sent — the SDK reports the server's reason, which is the intended behaviour for a row only an operator can repairKnown gap left alone
create()still has notag_columnsparameter, so a continuous query created through this SDK cannot declare its grouping dimensions. Pre-existing and separate from this fix.