cuddly-jelly-27016
07/01/2025, 11:37 PMImageSpec method is_container() returns True during fast registration with pyflyte run --remote or pyflyte register.
### Expected behavior
The ImageSpec method is_container() should return True only during execution in the corresponding container or during local execution.
### Additional context to reproduce
1. Implement the following workflow
from flytekit import ImageSpec, workflow, task
image_spec = ImageSpec(
packages=["pandas"],
registry=...
)
if image_spec.is_container():
import pandas as pd
@task(container_image=image_spec)
def task1():
df = pd.DataFrame()
@workflow
def wf1():
task1()
1. Create and activate a virtual environment with only flytekit==1.16.1
2. pyflyte run --remote or pyflyte register will try to execute the pandas import locally.
### Screenshots
No response
### Are you sure this issue hasn't been raised already?
• Yes
### Have you read the Code of Conduct?
• Yes
flyteorg/flyte