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

executing readme: 'not supported between instances of 'int' and 'NoneType' #104

Closed
ush19 opened this issue Jul 10, 2019 · 0 comments · Fixed by #106
Closed

executing readme: 'not supported between instances of 'int' and 'NoneType' #104

ush19 opened this issue Jul 10, 2019 · 0 comments · Fixed by #106
Assignees
Labels
bug Something isn't working
Milestone

Comments

@ush19
Copy link

ush19 commented Jul 10, 2019

  • SDV version: 0.1.1
  • Python version: 3.7.3
  • Operating System: macOS Mojave 10.14.5

Description

Hi, I'm trying to execute the readme instruction code and I'm seeing the following error when I execute:

samples = data_vault.sample_all()

I don't understand why num_rows is being read as a NoneType even though it should be an int but designated as a string in the comment block.

Traceback

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-4-27b4127b7320> in <module>
----> 1 samples = data_vault.sample_all()

~/Documents/igor_workspace/sdv_validation/SDV/sdv/sdv.py in sample_all(self, num_rows, reset_primary_keys)
     97             raise NotFittedError('SDV instance has not been fitted')
     98 
---> 99         return self.sampler.sample_all(num_rows, reset_primary_keys=reset_primary_keys)
    100 
    101     def save(self, filename):

~/Documents/igor_workspace/sdv_validation/SDV/sdv/sampler.py in sample_all(self, num_rows, reset_primary_keys)
    654         for table in tables:
    655             if not self.dn.get_parents(table):
--> 656                 self.sample_rows(table, num_rows, sampled_data=sampled_data)
    657 
    658         return sampled_data

~/Documents/igor_workspace/sdv_validation/SDV/sdv/sampler.py in sample_rows(self, table_name, num_rows, reset_primary_keys, sample_children, sampled_data)
    606         if sample_children:
    607             for child in self.dn.get_children(table_name):
--> 608                 self.sample_rows(child, sample_children=True, sampled_data=sampled_data)
    609 
    610         return sampled_data

~/Documents/igor_workspace/sdv_validation/SDV/sdv/sampler.py in sample_rows(self, table_name, num_rows, reset_primary_keys, sample_children, sampled_data)
    559             self._reset_primary_keys_generators()
    560 
--> 561         pk_name, pk_values = self._get_primary_keys(table_name, num_rows)
    562         parent_row = self._get_parent_row(table_name)
    563 

~/Documents/igor_workspace/sdv_validation/SDV/sdv/sampler.py in _get_primary_keys(self, table_name, num_rows)
    231                 remaining = self.remaining_primary_key[table_name]
    232 
--> 233             if remaining < num_rows:
    234                 raise ValueError(
    235                     'Not enough unique values for primary key of table {} with regex {}'

TypeError: '<' not supported between instances of 'int' and 'NoneType'
@ush19 ush19 changed the title executing readme: 'not supported between instances of 'int' and 'NoneType' [question] executing readme: 'not supported between instances of 'int' and 'NoneType' Jul 10, 2019
@ush19 ush19 changed the title [question] executing readme: 'not supported between instances of 'int' and 'NoneType' executing readme: 'not supported between instances of 'int' and 'NoneType' Jul 10, 2019
@ManuelAlvarezC ManuelAlvarezC self-assigned this Jul 11, 2019
@ManuelAlvarezC ManuelAlvarezC added the bug Something isn't working label Jul 11, 2019
@csala csala assigned csala and unassigned ManuelAlvarezC Jul 29, 2019
@csala csala added this to the 0.1.2 milestone Jul 29, 2019
@csala csala closed this as completed in #106 Aug 5, 2019
JonathanDZiegler pushed a commit to JonathanDZiegler/SDV that referenced this issue Feb 7, 2022
* Moved log_frequency to __init__

* Fixed test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants