# Buggy code
def set(*dataset, **kwargs):
    """
    Sets the property or list of properties to the given value(s) for each dataset.

    dataset : string
        name of snapshot(s), filesystem(s), or volume(s)
    properties : string
        additional zfs properties pairs

    .. note::

        properties are passed as key-value pairs. e.g.

            compression=off

    .. note::

        Only some properties can be edited.

        See the Properties section for more information on what properties
        can be set and acceptable values.

        Numeric values can be specified as exact values, or in a human-readable
        form with a suffix of B, K, M, G, T, P, E (for bytes, kilobytes,
        megabytes, gigabytes, terabytes, petabytes, or exabytes respectively).

    .. versionadded:: 2016.3.0

    CLI Example:

    .. code-block:: bash

        salt '*' zfs.set myzpool/mydataset compression=off
        salt '*' zfs.set myzpool/mydataset myzpool/myotherdataset compression=off
        salt '*' zfs.set myzpool/mydataset myzpool/myotherdataset compression=lz4 canmount=off

    """
    ## Configure command
    # NOTE: push filesystem properties
    filesystem_properties = salt.utils.args.clean_kwargs(**kwargs)

    ## Set property
    res = __salt__["cmd.run_all"](
        __utils__["zfs.zfs_command"](
            command="set",
            property_name=filesystem_properties.keys(),
            property_value=filesystem_properties.values(),
            target=list(dataset),
        ),
        python_shell=False,
    )

    return __utils__["zfs.parse_command_result"](res, "set")


# Traceback (TypeError)
2019-09-09 20:01:36,195 [salt.state       :1852][INFO    ][23094] Executing state zfs.filesystem_present for [observium/root]
2019-09-09 20:01:36,200 [salt.loaded.int.module.cmdmod:397 ][INFO    ][23094] Executing command '/sbin/zfs list -t filesystem observium/root' in directory '/home/milton'
2019-09-09 20:01:36,211 [salt.loaded.int.module.cmdmod:397 ][INFO    ][23094] Executing command '/sbin/zfs get -H -o name,property,value -t filesystem all observium/root' in directory '/home/milton'
2019-09-09 20:01:36,231 [salt.state       :322 ][ERROR   ][23094] An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/salt/state.py", line 1933, in call
**cdata['kwargs'])
File "/usr/lib/python3/dist-packages/salt/loader.py", line 1939, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python3/dist-packages/salt/states/zfs.py", line 582, in filesystem_present
cloned_from=cloned_from,
File "/usr/lib/python3/dist-packages/salt/states/zfs.py", line 483, in _dataset_present
mod_res = __salt__['zfs.set'](name, **{prop: properties[prop]})
File "/usr/lib/python3/dist-packages/salt/modules/zfs.py", line 1150, in set
target=list(dataset),
File "/usr/lib/python3/dist-packages/salt/utils/zfs.py", line 644, in zfs_command
target=target,
File "/usr/lib/python3/dist-packages/salt/utils/zfs.py", line 263, in _command
val=to_auto(key, val, source=source, convert_to_human=False),
File "/usr/lib/python3/dist-packages/salt/utils/zfs.py", line 572, in to_auto
return _auto('to', name, value, source, convert_to_human)
File "/usr/lib/python3/dist-packages/salt/utils/zfs.py", line 169, in _auto
value_type = props[name]['type'] if name in props else 'str'
TypeError: unhashable type: 'dict_keys'

# Fixed code
def set(*dataset, **kwargs):
    """
    Sets the property or list of properties to the given value(s) for each dataset.

    dataset : string
        name of snapshot(s), filesystem(s), or volume(s)
    properties : string
        additional zfs properties pairs

    .. note::

        properties are passed as key-value pairs. e.g.

            compression=off

    .. note::

        Only some properties can be edited.

        See the Properties section for more information on what properties
        can be set and acceptable values.

        Numeric values can be specified as exact values, or in a human-readable
        form with a suffix of B, K, M, G, T, P, E (for bytes, kilobytes,
        megabytes, gigabytes, terabytes, petabytes, or exabytes respectively).

    .. versionadded:: 2016.3.0

    CLI Example:

    .. code-block:: bash

        salt '*' zfs.set myzpool/mydataset compression=off
        salt '*' zfs.set myzpool/mydataset myzpool/myotherdataset compression=off
        salt '*' zfs.set myzpool/mydataset myzpool/myotherdataset compression=lz4 canmount=off

    """
    ## Configure command
    # NOTE: push filesystem properties
    filesystem_properties = salt.utils.args.clean_kwargs(**kwargs)

    ## Set property
    res = __salt__["cmd.run_all"](
        __utils__["zfs.zfs_command"](
            command="set",
            property_name=list(filesystem_properties.keys()),
            property_value=list(filesystem_properties.values()),
            target=list(dataset),
        ),
        python_shell=False,
    )

    return __utils__["zfs.parse_command_result"](res, "set")