{"record":{"id":"f6bfa81d285a20ec","repo":"apache/beam","slug":"unknown-type-of-encoding-context","errorCode":null,"errorMessage":"Unknown type of encoding context","messagePattern":"Unknown type of encoding context","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/typescript/src/apache_beam/coders/required_coders.ts","lineNumber":97,"sourceCode":"   * console.log(w1.finish())  // ==> prints Uint8Array(6) [ 5, 98, 121, 116, 101, 115 ], where 5 is the length prefix.\n   * const w2 = new Writer()\n   * new BytesCoder().encode(\"bytes\", w1, Context.wholeStream)\n   * console.log(w2.finish())  // ==> prints Uint8Array(5) [ 98, 121, 116, 101, 115 ], without the length prefix\n   * ```\n   * @param value - a byte array to encode. This represents an element to be encoded.\n   * @param writer - a writer to access the stream of bytes with encoded data\n   * @param context - whether to encode the data with delimiters (`Context.needsDelimiters`), or without (`Context.wholeStream`).\n   */\n  encode(value: Uint8Array, writer: Writer, context: Context) {\n    switch (context) {\n      case Context.wholeStream:\n        writeRawBytes(value, writer);\n        break;\n      case Context.needsDelimiters:\n        writer.bytes(value);\n        break;\n      default:\n        throw new Error(\"Unknown type of encoding context\");\n    }\n  }\n\n  /**\n   * Decode the input byte stream into a byte array.\n   * If context is `needsDelimiters`, the first bytes will be interpreted as a var-int32 encoding\n   * the length of the data.\n   *\n   * If the context is `wholeStream`, the whole input stream is decoded as-is.\n   *\n   * @param reader - a reader to access the input byte stream\n   * @param context - whether the data is encoded with delimiters (`Context.needsDelimiters`), or without (`Context.wholeStream`).\n   * @returns\n   */\n  decode(reader: Reader, context: Context): Uint8Array {\n    switch (context) {\n      case Context.wholeStream:\n        return reader.buf.slice(reader.pos);","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/typescript/src/apache_beam/coders/required_coders.ts#L79-L115","documentation":"SchemaTransformDiscovery.discover_config queries an expansion service for available SchemaTransforms and filters them by substring match against the requested name. If no identifier contains the given name, ValueError is raised. This means the requested transform does not exist in the service's catalog.","triggerScenarios":"Calling discover_config(name) (or XWithSchemaTransforms helpers) where no returned SchemaTransform identifier contains `name` as a substring, e.g. discover_config('BigQueery') or a transform not provided by that expansion service jar.","commonSituations":"Typos in transform names; expecting Java transforms from a service jar that does not include them; using a stale or too-old expansion service that lacks the transform.","solutions":["Correct the transform name to match (case-sensitively as substring) the SchemaTransform identifier.","List available transforms to see valid names, e.g. iterate external.SchemaTransforms / the catalog returned by the expansion service.","Point expansion_service at a jar that actually contains the desired transform."],"exampleFix":"// before\nSchemaTransforms.discover_config('KafKa')  # no match\n// after\nSchemaTransforms.discover_config('Kafka')  # e.g. 'beam:schematransform:org.apache.beam:kafka_read:v1'","handlingStrategy":"validation","validationCode":"catalog = [st.identifier for st in schematransforms]\nassert any(name in ident for ident in catalog), f'{name!r} not in {catalog}'","typeGuard":"def resolves_to_one(name: str, identifiers: list[str]) -> bool:\n    return sum(name in i for i in identifiers) == 1","tryCatchPattern":"try:\n    cfg = SchemaTransforms.discover_config(name, expansion_service=svc)\nexcept ValueError as e:\n    logger.error('No SchemaTransform matched %r: %s', name, e)\n    cfg = None","preventionTips":["List the expansion service catalog first and copy names exactly","Check the jar actually bundles the transform you want","Watch for typos and case in transform names"],"tags":["python","apache-beam","schema-transform","discovery","naming"],"backgroundTag":"entity-not-found","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}