I am new to Beam and struggling to find many good guides and resources to learn best practices.
One thing I have noticed is there are two ways pipelines are defined:
with beam.Pipeline() as p:
# pipeline code in here
Or
p = beam.Pipeline()
# pipeline code in here
result = p.run()
result.wait_until_finish()
Are there specific situations in which each method is preferred?