HDFS Asset URI: allow empty netloc for Hadoop fs.defaultFS#68022
Open
stegololz wants to merge 1 commit into
Open
HDFS Asset URI: allow empty netloc for Hadoop fs.defaultFS#68022stegololz wants to merge 1 commit into
stegololz wants to merge 1 commit into
Conversation
The hdfs asset URI sanitizer rejected hdfs:///path as missing a namenode host. Per RFC 3986 the authority component is optional; per Hadoop semantics an empty authority means 'resolve via fs.defaultFS from core-site.xml' — i.e. hdfs:///apps/x is the canonical form for jobs that must not hard-code a namenode. Relax sanitize_uri to require only a non-empty path, and add positive + negative parametrized tests covering the default-fs form and the corresponding OpenLineage conversion.
dabla
approved these changes
Jun 4, 2026
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
Relax
airflow.providers.apache.hdfs.assets.hdfs.sanitize_urito accept the canonicalhdfs:///pathform (empty netloc). Previously rejected withValueError: URI format hdfs:// must contain a namenode host.Why
hdfs:///pathis well-formed.fs.defaultFSfromcore-site.xml". This is the standard idiom for portable Spark/Hive/MapReduce jobs that must not hard-code a namenode — same shape asfile:///etc/hosts.Asset("hdfs:///apps/x/file.parquet")at parse time.Change
providers/apache/hdfs/.../assets/hdfs.py: drop the "must contain a namenode host" check; keep the path-required check.providers/apache/hdfs/.../tests/.../test_hdfs.py:hdfs:///apps/myapp/...(empty netloc) — pass.hdfs://namenode:8020(no path) — fail.test_convert_asset_to_openlineage_default_fscovering OpenLineage emission with empty netloc.convert_asset_to_openlineagealready tolerates an empty netloc (f"hdfs://{parsed.netloc}"yieldshdfs://namespace), so no functional change there.Related
Gen-AI disclosure
This PR was prepared with Gen-AI assistance (Claude). I reviewed all generated code.