Richard Schulz
10/09/2024, 2:18 PMThierry Jean
10/09/2024, 2:39 PMDriver? Also, how did you identify the race condition? Was there a raised exception?
For synchronous execution, you should have something like
from hamilton import driver
from hamilton.execution.executors import SynchronousLocalTaskExecutor
dr = (
driver.Builder()
.with_modules(parallel_linear_basic)
.enable_dynamic_execution(allow_experimental_mode=True)
.with_remote_executor(SynchronousLocalTaskExecutor())
.build()
)Elijah Ben Izzy
10/09/2024, 3:56 PMParallizable[…] and `Collect`… Curious if that solves your issue!Richard Schulz
10/11/2024, 6:02 AM<http://pd.to|pd.to>__sql("my_table", data, 'append') . The method failed because the Table was already created. That can't happen in a non parallel execution, beacuse it checks if the table exists before creation.Richard Schulz
10/11/2024, 6:13 AMdr = (
driver.Builder()
.with_modules(parralel_dag)
.enable_dynamic_execution(allow_experimental_mode=True)
.with_local_executor(executors.MultiProcessingExecutor(max_tasks=1))
.build()
)
Running the DAG like this results in an error.
RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase.Thierry Jean
10/11/2024, 1:30 PMElijah Ben Izzy
10/11/2024, 2:01 PM.with_remote_executor) to the synchronous executor, not set the local one to the multiprocessing one. Can get you a snippet later! As to that error, it’s an odd case but worth looking into? Don’t think that code is doing what you want…Elijah Ben Izzy
10/11/2024, 4:49 PMto_sql might have a problem with concurreny… Are you running it inside the parallel block? Or outside?