So, I am working on a multi table SDV project. When I am importing Metadata from sdv multi table library, I am getting the following error as you can see the below screenshot:-
I have tried with the previous versions but still getting the same error. And when I try to import MultiTableMetadata instead of Metadata then it is getting imported but while detecting the data from dataframes, I am getting the following error as you can see in the below screenshots:-
About MultiTableMetadata import, nothing is provided in the documentation. I have checked the github for these methods as well, they are available there but still not able to import or work with them. I guess either SDV documentation or SDV code issue is there.
Thanks.
Tl;dr Your issue is probably due to using an SDV Enterprise version older than 0.18.0. Upgrading should fix the issue. More details below.
Details
The recommended approach is to use the Metadata class, as mentioned in the docs. (The MultiTableMetadata method is for older versions of SDV. It is not recommended anymore, and it does not appear in our docs anymore either.)
from sdv.metadata import Metadata
from sdv.io.local import CSVHandler
# read all CSVs from a folder into Python (dataframe)
connector = CSVHandler()
data = connector.read(folder_name='project/data/')
# automatically infer metadata from the dataframe
metadata = Metadata.detect_from_dataframes(data)
The Metadata object is new, available starting from SDV Enterprise version 0.18.0 and above. You can run the commands below to see which version you have.
import sdv
print(sdv.version.enterprise)
If the version is less than 0.18.0, I would recommend upgrading. Or if you are unable to upgrade, let us know.
Resources
Installation Instructions this is the same for first-time installation as well as upgrading to a later version
Hello, I’m marking this as resolved since we have supplied a solution. If you are still continuing to experience this issue, feel free to reply below and we can always continue the investigation.