databricks-demos / dbdemos

Demos to implement your Databricks Lakehouse
Other
273 stars 87 forks source link

Autoloader Demo: stop_all_streams() failing as 'stream_count' is not defined #3

Closed mqunelldb closed 1 year ago

mqunelldb commented 1 year ago

The function below references 'stream_count' which is not defined. Likely should be = len(streams)


# Function to stop all streaming queries 
def stop_all_streams(start_with = ""):
  streams = get_active_streams(start_with)
  if len(streams) > 0:
    print(f"Stopping {stream_count} streams")
    for s in streams:
        try:
            s.stop()
        except:
            pass
    print(f"All stream stopped (starting with: {start_with}.")
QuentinAmbard commented 1 year ago

Thanks, it should be fixed now - let me know if you see another issue