{"record":{"id":"fb1a91aca6295be4","repo":"apache/beam","slug":"kafka-transforms-moved-to-apache-beam-io-kafka","errorCode":null,"errorMessage":"Kafka transforms moved to apache_beam.io.kafka","messagePattern":"Kafka transforms moved to apache_beam\\.io\\.kafka","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"sdks/python/apache_beam/io/external/kafka.py","lineNumber":30,"sourceCode":"# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n# For backwards compatibility.\n\n# pytype: skip-file\n\nimport warnings\n\n# pylint: disable=unused-import\nfrom apache_beam.io.kafka import ReadFromKafka\nfrom apache_beam.io.kafka import ReadFromKafkaSchema\nfrom apache_beam.io.kafka import WriteToKafka\nfrom apache_beam.io.kafka import WriteToKafkaSchema\n\nwarnings.warn(\n    \"Kafka transforms moved to apache_beam.io.kafka\", DeprecationWarning)\n","sourceCodeStart":12,"sourceCodeEnd":32,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/io/external/kafka.py#L12-L32","documentation":"Importing apache_beam.io.external.kafka emits a DeprecationWarning because the Kafka transforms (ReadFromKafka, ReadFromKafkaSchema, WriteToKafka, WriteToKafkaSchema) were relocated to apache_beam.io.kafka. The old module is a backward-compatibility re-export shim that warns at import time.","triggerScenarios":"Any execution of `from apache_beam.io.external.kafka import ReadFromKafka` (or the other three re-exported names) at module import time.","commonSituations":"Pipelines written against older Beam versions or copied from pre-migration examples/tutorials; dependency upgrades where code still imports from the legacy io.external path.","solutions":["Change imports to `from apache_beam.io.kafka import ReadFromKafka` etc.","Run `grep -r 'io.external.kafka' .` and update every occurrence.","Pin/upgrade apache-beam to a version where the new module exists and re-run tests."],"exampleFix":"// before\nfrom apache_beam.io.external.kafka import ReadFromKafka\n// after\nfrom apache_beam.io.kafka import ReadFromKafka","handlingStrategy":"validation","validationCode":"import warnings\nwith warnings.catch_warnings(record=True) as w:\n    warnings.simplefilter('always')\n    import apache_beam.io.external.kafka  # noqa\n    if any('moved to apache_beam.io.kafka' in str(x.message) for x in w):\n        raise ImportError('Use apache_beam.io.kafka instead')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Import Beam IO transforms from apache_beam.io.* top-level modules, not io.external.* shims.","Treat DeprecationWarnings as errors in CI: -W error::DeprecationWarning.","Periodically grep the repo for 'io.external.' imports."],"tags":["python","deprecation","apache-beam","kafka"],"backgroundTag":"deprecated-api-usage","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}