Beam/Dataflow: No session file found: /var/opt/google/dataflow/pickled_main_session

Viewed 370

When using Apache Beam (GCP Dataflow) I see the following warning in worker logs:

No session file found: /var/opt/google/dataflow/pickled_main_session. Functions defined in __main__ (interactive session) may fail.

My Dataflow job seems to be fine regardless, but I'm wondering what this warning is all about.

I have seen the following in some sample code (which I am NOT currently doing):

pipeline_options.view_as(SetupOptions).save_main_session = True

where pipeline_options is the main way of specifying options for the Beam/Dataflow pipeline, as in the following later in the code:

with beam.Pipeline(options=pipeline_options) as p:
    # actual pipeline code here

I am curious if the two are related. Does the presence of the warning mean I should always be saving the main session? Are these two things related? Unrelated?

1 Answers

You should be able to safely ignore this warning. No need to set save_main_session if it's not required for your pipeline.

Related