# Buggy code
def __read_data_stream(self, name, schema):
    sav = helpers.import_from_plugin("savReaderWriter", plugin="spss")
    path = self.__write_convert_name(name)
    with sav.SavReader(path, ioUtf8=True, rawMode=False) as reader:
        for item in reader:
            cells = []
            for index, field in enumerate(schema.fields):
                value = item[index]
                # Fix decimals that should be integers
                if field.type == "integer" and value is not None:
                    value = int(float(value))
                # We need to decode bytes to strings
                if isinstance(value, bytes):
                    value = value.decode(reader.fileEncoding)
                # Time values need a decimal, add one if missing.
                if field.type == "time" and not re.search(r"\.\d*", value):
                    value = "{}.0".format(value)
                cells.append(value)
            yield cells


# Traceback (ModuleNotFoundError)
In [1]: from frictionless import describe_package

In [2]: csv = 'a,b\n0,1'

In [3]: with open('test.csv', 'w') as f:
...:     f.write(csv)
...:

In [4]: package = describe_package('test.csv')
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-4-4f4f7e6b6d26> in <module>
----> 1 package = describe_package('test.csv')

/tmp/bug-frictionless/env/lib/python3.6/site-packages/frictionless/describe/package.py in describe_package(source, basepath, trusted, expand)
22     # Infer package
23     package = Package(basepath=basepath, trusted=trusted)
---> 24     package.infer(source)
25
26     # Expand package

/tmp/bug-frictionless/env/lib/python3.6/site-packages/frictionless/package.py in infer(self, source, only_sample)
223         # General
224         for resource in self.resources:
--> 225             resource.infer(only_sample=only_sample)
226
227     # Import/Export

/tmp/bug-frictionless/env/lib/python3.6/site-packages/frictionless/resource.py in infer(self, source, only_sample)
372
373         # Tabular
--> 374         if self.tabular:
375             with self.to_table() as table:
376                 patch["profile"] = "tabular-data-resource"

/tmp/bug-frictionless/env/lib/python3.6/site-packages/frictionless/helpers.py in __get__(self, instance, owner)
430                 val = cache.get(self.attrname, config.UNDEFINED)
431                 if val is config.UNDEFINED:
--> 432                     val = self.func(instance)
433                     try:
434                         cache[self.attrname] = val

/tmp/bug-frictionless/env/lib/python3.6/site-packages/frictionless/resource.py in tabular(self)
209             bool: if resource is tabular
210         """
--> 211         table = self.to_table()
212         try:
213             table.open()

/tmp/bug-frictionless/env/lib/python3.6/site-packages/frictionless/resource.py in to_table(self, **options)
684         if "lookup" not in options:
685             options["lookup"] = self.read_lookup()
--> 686         return Table(**options)
687
688     def to_file(self, **options):

/tmp/bug-frictionless/env/lib/python3.6/site-packages/frictionless/table.py in __init__(self, source, scheme, format, hashing, encoding, compression, compression_path, control, dialect, query, headers, schema, sync_schema, patch_schema, infer_type, infer_names, infer_volume, infer_confidence, infer_missing_values, lookup)
191             control=control,
192             dialect=dialect,
--> 193             query=query,
194         )
195

/tmp/bug-frictionless/env/lib/python3.6/site-packages/frictionless/file.py in __init__(self, source, scheme, format, hashing, encoding, compression, compression_path, control, dialect, query, newline, stats)
94
95         # Initialize file
---> 96         super().__init__()
97
98     def __enter__(self):

/tmp/bug-frictionless/env/lib/python3.6/site-packages/frictionless/metadata.py in __init__(self, descriptor)
40         for key, value in metadata.items():
41             dict.setdefault(self, key, value)
---> 42         self.__onchange__()
43
44     def __setattr__(self, name, value):

/tmp/bug-frictionless/env/lib/python3.6/site-packages/frictionless/metadata.py in __onchange__(self, onchange)
66                 if reset and key in self.__dict__:
67                     self.__dict__.pop(key)
---> 68             self.metadata_process()
69             if self.metadata_strict:
70                 for error in self.metadata_errors:

/tmp/bug-frictionless/env/lib/python3.6/site-packages/frictionless/file.py in metadata_process(self)
371         dialect = self.get("dialect")
372         if dialect is not None:
--> 373             dialect = system.create_dialect(self, descriptor=dialect)
374             dict.__setitem__(self, "dialect", dialect)
375

/tmp/bug-frictionless/env/lib/python3.6/site-packages/frictionless/system.py in create_dialect(self, file, descriptor)
110         name = file.format
111         dialects = import_module("frictionless.dialects")
--> 112         for func in self.methods["create_dialect"].values():
113             dialect = func(file, descriptor=descriptor)
114             if dialect is not None:

/tmp/bug-frictionless/env/lib/python3.6/site-packages/frictionless/helpers.py in __get__(self, instance, owner)
430                 val = cache.get(self.attrname, config.UNDEFINED)
431                 if val is config.UNDEFINED:
--> 432                     val = self.func(instance)
433                     try:
434                         cache[self.attrname] = val

/tmp/bug-frictionless/env/lib/python3.6/site-packages/frictionless/system.py in methods(self)
229         for action in self.actions:
230             methods[action] = OrderedDict()
--> 231             for name, plugin in self.plugins.items():
232                 if action in vars(type(plugin)):
233                     func = getattr(plugin, action, None)

/tmp/bug-frictionless/env/lib/python3.6/site-packages/frictionless/helpers.py in __get__(self, instance, owner)
430                 val = cache.get(self.attrname, config.UNDEFINED)
431                 if val is config.UNDEFINED:
--> 432                     val = self.func(instance)
433                     try:
434                         cache[self.attrname] = val

/tmp/bug-frictionless/env/lib/python3.6/site-packages/frictionless/system.py in plugins(self)
246         module = import_module("frictionless.plugins")
247         for _, name, _ in pkgutil.iter_modules([os.path.dirname(module.__file__)]):
--> 248             module = import_module(f"frictionless.plugins.{name}")
249             modules[name] = module
250         plugins = OrderedDict()

/usr/lib/python3.6/importlib/__init__.py in import_module(name, package)
124                 break
125             level += 1
--> 126     return _bootstrap._gcd_import(name[level:], package, level)
127
128

/usr/lib/python3.6/importlib/_bootstrap.py in _gcd_import(name, package, level)

/usr/lib/python3.6/importlib/_bootstrap.py in _find_and_load(name, import_)

/usr/lib/python3.6/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)

/usr/lib/python3.6/importlib/_bootstrap.py in _load_unlocked(spec)

/usr/lib/python3.6/importlib/_bootstrap_external.py in exec_module(self, module)

/usr/lib/python3.6/importlib/_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)

/tmp/bug-frictionless/env/lib/python3.6/site-packages/frictionless/plugins/bigquery.py in <module>
4 import time
5 import unicodecsv
----> 6 from slugify import slugify
7 from ..resource import Resource
8 from ..storage import Storage

ModuleNotFoundError: No module named 'slugify'

# Fixed code
def __read_data_stream(self, name, schema):
    sav = helpers.import_from_plugin("savReaderWriter", plugin="spss")
    path = self.__write_convert_name(name)
    yield schema.field_names
    with sav.SavReader(path, ioUtf8=True, rawMode=False) as reader:
        for item in reader:
            cells = []
            for index, field in enumerate(schema.fields):
                value = item[index]
                # Fix decimals that should be integers
                if field.type == "integer" and value is not None:
                    value = int(float(value))
                # We need to decode bytes to strings
                if isinstance(value, bytes):
                    value = value.decode(reader.fileEncoding)
                # Time values need a decimal, add one if missing.
                if field.type == "time" and not re.search(r"\.\d*", value):
                    value = "{}.0".format(value)
                cells.append(value)
            yield cells