I'm having a problem withe FlyteFile where remote_...
# ask-the-community
h
I'm having a problem withe FlyteFile where remote_path isn't populated. Relevant snippet from the task:
Copy code
bam_file = FlyteFile(path=bam_file)
    remote_bam_file = FlyteFile.new_remote_file(f'{well_reads.well}.bam')
    with bam_file.open("rb") as r:
        with remote_bam_file.open("wb") as w:
            w.write(r.read())
    well_reads.bam_file = remote_bam_file
    return well_reads
Then when I try to access well_reads.bam_file.remote_path later on it's empty. Am I doing something wrong?
y
can you elaborate more the goal?
it looks like you’re just trying to copy a file?
h
What I'd like to get is a FlyteFile with a remote path (gs://etc/ ). I took this snippet from the documentation at https://docs.flyte.org/en/latest/api/flytekit/generated/flytekit.types.file.FlyteFile.html#flytekit.types.file.FlyteFile.new_remote_file
y
for what purpose? are you just trying to write a local file to gcs?
that example is a bit contrived
h
yeah, basically i want it in the gs flyte directory, so that i can have a look at it later.