mostlyai-mock 0.1.9__py3-none-any.whl → 0.1.11__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
mostlyai/mock/__init__.py CHANGED
@@ -15,4 +15,4 @@
15
15
  from mostlyai.mock.core import sample
16
16
 
17
17
  __all__ = ["sample"]
18
- __version__ = "0.1.9" # Do not set this manually. Use poetry version [params].
18
+ __version__ = "0.1.11" # Do not set this manually. Use poetry version [params].
mostlyai/mock/core.py CHANGED
@@ -748,7 +748,7 @@ async def _create_table_rows_generator(
748
748
  context_data = data[context_table_name]
749
749
  batch_size = 1 # generate 1 sequence at a time
750
750
  sample_size = len(context_data)
751
- context_batches = [data.iloc[i : i + batch_size] for i in range(0, len(data), batch_size)]
751
+ context_batches = [context_data.iloc[i : i + batch_size] for i in range(0, len(context_data), batch_size)]
752
752
 
753
753
  # derive non-context data (if more than one foreign key is present)
754
754
  non_context_data: dict[str, pd.DataFrame] = {}
@@ -1252,7 +1252,10 @@ def sample(
1252
1252
  for table_name in execution_plan:
1253
1253
  table_config = config.root[table_name]
1254
1254
 
1255
- with concurrent.futures.ThreadPoolExecutor(max_workers=1) as executor:
1255
+ # synchronous `sample` function makes independent calls to asynchronous `_sample_table` function
1256
+ # in order to avoid conflicts with potentially existing event loop (e.g. in Jupyter environment),
1257
+ # a new process is spawned for each call to `_sample_table`
1258
+ with concurrent.futures.ProcessPoolExecutor(max_workers=1) as executor:
1256
1259
  future = executor.submit(
1257
1260
  _sample_table_sync,
1258
1261
  name=table_name,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mostlyai-mock
3
- Version: 0.1.9
3
+ Version: 0.1.11
4
4
  Summary: Synthetic Mock Data
5
5
  Project-URL: homepage, https://github.com/mostly-ai/mostlyai-mock
6
6
  Project-URL: repository, https://github.com/mostly-ai/mostlyai-mock
@@ -0,0 +1,8 @@
1
+ mostlyai/mock/__init__.py,sha256=TijW-xX5zpSpPThkVonR3iwZThtry7MlDSg03EWcZLc,715
2
+ mostlyai/mock/core.py,sha256=K3f5i4C7Q50xF-o2OAwzTNKxiUW7qzLW3z5rGDlPbS4,54873
3
+ mostlyai/mock/mcp_server.py,sha256=MrVUrIsAZsFzjK1suwNl1fxS1ES-wpc-YSM8cS8Fqcw,2259
4
+ mostlyai_mock-0.1.11.dist-info/METADATA,sha256=qqva72RqPxlajbDMDxLUqCm1n06-lgL04Wj8A-3WDbw,14100
5
+ mostlyai_mock-0.1.11.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
6
+ mostlyai_mock-0.1.11.dist-info/entry_points.txt,sha256=XDbppUIAaCWW0nresVep8zb71pkzZuFA16jCBHq8CU8,61
7
+ mostlyai_mock-0.1.11.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
8
+ mostlyai_mock-0.1.11.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- mostlyai/mock/__init__.py,sha256=Kh6EZ-dkw2v6SuuWM0ygkKVJmBslJNP2sTsu_CE2JXM,714
2
- mostlyai/mock/core.py,sha256=Os_nBMrwvB_noIwBMkA0R1z6jzvFcUByGEPoGIyoh78,54577
3
- mostlyai/mock/mcp_server.py,sha256=MrVUrIsAZsFzjK1suwNl1fxS1ES-wpc-YSM8cS8Fqcw,2259
4
- mostlyai_mock-0.1.9.dist-info/METADATA,sha256=J59K-sxrbMat0x87P1mObxjUsELCGEBYhS_k-raT_-8,14099
5
- mostlyai_mock-0.1.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
6
- mostlyai_mock-0.1.9.dist-info/entry_points.txt,sha256=XDbppUIAaCWW0nresVep8zb71pkzZuFA16jCBHq8CU8,61
7
- mostlyai_mock-0.1.9.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
8
- mostlyai_mock-0.1.9.dist-info/RECORD,,