<#1040 fix: coerce CopyConfig.src to Path in __pos...
# flyte-github
a
#1040 fix: coerce CopyConfig.src to Path in __post_init__ Pull request opened by EngHabu Summary •
CopyConfig
is a frozen dataclass with
src: Path
, but is constructed with
str
from some call sites (and via deserialization). At runtime
update_hash()
calls
self.src.is_dir()
and crashes with
AttributeError: 'str' object has no attribute 'is_dir'
. • Coerce
src
to
Path
inside
__post_init__
(using
object.__setattr__
because the dataclass is frozen, matching existing patterns in this file). Closes • FLYTE-SDK-11 —
AttributeError: 'str' object has no attribute 'is_dir'
in
flyte._image.update_hash
Test plan • New unit test in
tests/flyte/test_image.py
constructs
CopyConfig
with a string
src
and asserts both the coerced type and that
update_hash
runs. • Existing
CopyConfig
tests still pass. 🤖 Generated with Claude Code flyteorg/flyte-sdk