Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal import error in Databricks sdv.errors #2359

Open
OscarFlores-IFi opened this issue Jan 28, 2025 · 1 comment
Open

Internal import error in Databricks sdv.errors #2359

OscarFlores-IFi opened this issue Jan 28, 2025 · 1 comment
Assignees
Labels
bug Something isn't working under discussion Issue is currently being discussed

Comments

@OscarFlores-IFi
Copy link

Environment Details

Please indicate the following details about the environment in which you found the bug:

  • CTGAN version: ctgan==0.10.2
  • Python version: 3.8.10
  • Operating System: Databricks
  • SDV version: 1.17.0

Error Description

Trying to follow the demo in https://colab.research.google.com/drive/15iom9fO8j_gHg4-NlGkzWF5thMWStXwv?usp=sharing
just importing CTGANSynthesizer generates an error because sdv.errors cannot be imported (perhaps sdv.error missing in the .init?)

raised issue initially in CTGAN: sdv-dev/CTGAN#429
Maybe is more appropiate to raise it here?

Steps to reproduce

from sdv.single_table import CTGANSynthesizer

ImportError: cannot import name 'NonParametricError' from 'sdv.errors' (/databricks/python/lib/python3.8/site-packages/sdv/errors.py)
ImportError Traceback (most recent call last)
in
----> 1 from sdv.single_table import CTGANSynthesizer
2
3 synthesizer = CTGANSynthesizer(metadata)
4 synthesizer.fit(real_data)

/databricks/python_shell/dbruntime/PythonPackageImportsInstrumentation/init.py in import_patch(name, globals, locals, fromlist, level)
165 # Import the desired module. If you’re seeing this while debugging a failed import,
166 # look at preceding stack frames for relevant error information.
--> 167 original_result = python_builtin_import(name, globals, locals, fromlist, level)
168
169 is_root_import = thread_local._nest_level == 1

/databricks/python/lib/python3.8/site-packages/sdv/single_table/init.py in
1 """Synthesizers for Single Table data."""
2
----> 3 from sdv.single_table.copulagan import CopulaGANSynthesizer
4 from sdv.single_table.copulas import GaussianCopulaSynthesizer
5 from sdv.single_table.ctgan import CTGANSynthesizer, TVAESynthesizer

/databricks/python_shell/dbruntime/PythonPackageImportsInstrumentation/init.py in import_patch(name, globals, locals, fromlist, level)
165 # Import the desired module. If you’re seeing this while debugging a failed import,
166 # look at preceding stack frames for relevant error information.
--> 167 original_result = python_builtin_import(name, globals, locals, fromlist, level)
168
169 is_root_import = thread_local._nest_level == 1

/databricks/python/lib/python3.8/site-packages/sdv/single_table/copulagan.py in
6 import rdt
7
----> 8 from sdv.single_table.copulas import GaussianCopulaSynthesizer
9 from sdv.single_table.ctgan import CTGANSynthesizer
10 from sdv.single_table.utils import (

/databricks/python_shell/dbruntime/PythonPackageImportsInstrumentation/init.py in import_patch(name, globals, locals, fromlist, level)
165 # Import the desired module. If you’re seeing this while debugging a failed import,
166 # look at preceding stack frames for relevant error information.
--> 167 original_result = python_builtin_import(name, globals, locals, fromlist, level)
168
169 is_root_import = thread_local._nest_level == 1

/databricks/python/lib/python3.8/site-packages/sdv/single_table/copulas.py in
14 from rdt.transformers import OneHotEncoder
15
---> 16 from sdv.errors import NonParametricError
17 from sdv.single_table.base import BaseSingleTableSynthesizer
18 from sdv.single_table.utils import (

ImportError: cannot import name 'NonParametricError' from 'sdv.errors' (/databricks/python/lib/python3.8/site-packages/sdv/errors.py)

@OscarFlores-IFi OscarFlores-IFi added bug Something isn't working new Automatic label applied to new issues labels Jan 28, 2025
@srinify
Copy link
Contributor

srinify commented Jan 29, 2025

Hi there @OscarFlores-IFi

I'm sorry that you're running into this issue! I'm not able to reproduce this locally or on Colab with a clean installation but it looks like there might be a version mismatch with some library in your installation.

Can you share a bit more about the Databricks environment or product you're using, and the commands you used to install the SDV?

@srinify srinify added under discussion Issue is currently being discussed and removed new Automatic label applied to new issues labels Jan 29, 2025
@srinify srinify self-assigned this Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working under discussion Issue is currently being discussed
Projects
None yet
Development

No branches or pull requests

2 participants