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

Snakemake crashes with AttributeError: 'str' object has no attribute 'name #1892

Closed
Redmar-van-den-Berg opened this issue Oct 7, 2022 · 7 comments · Fixed by #1898
Closed
Labels
bug Something isn't working

Comments

@Redmar-van-den-Berg
Copy link
Contributor

Snakemake version
snakemake --version
7.15.1

Describe the bug
The snakemake process crashes on a minimal workflow.

Logs

$ snakemake --snakefile test.smk  -c 1
Building DAG of jobs...
Using shell: /usr/bin/bash
Provided cores: 1 (use --cores to define parallelism)
Rules claiming more threads will be scaled down.
Traceback (most recent call last):
  File "/home/user/miniconda3/envs/HAMLET/lib/python3.10/site-packages/snakemake/__init__.py", line 733, in snakemake
    success = workflow.execute(
  File "/home/user/miniconda3/envs/HAMLET/lib/python3.10/site-packages/snakemake/workflow.py", line 1031, in execute
    logger.run_info("\n".join(dag.stats()))
  File "/home/user/miniconda3/envs/HAMLET/lib/python3.10/site-packages/snakemake/dag.py", line 2415, in stats
    yield tabulate(rows, headers="keys")
  File "/home/user/miniconda3/envs/HAMLET/lib/python3.10/site-packages/tabulate/__init__.py", line 2048, in tabulate
    list_of_lists, headers = _normalize_tabular_data(
  File "/home/user/miniconda3/envs/HAMLET/lib/python3.10/site-packages/tabulate/__init__.py", line 1471, in _normalize_tabular_data
    rows = list(map(lambda r: r if _is_separating_line(r) else list(r), rows))
  File "/home/user/miniconda3/envs/HAMLET/lib/python3.10/site-packages/tabulate/__init__.py", line 1471, in <lambda>
    rows = list(map(lambda r: r if _is_separating_line(r) else list(r), rows))
  File "/home/user/miniconda3/envs/HAMLET/lib/python3.10/site-packages/tabulate/__init__.py", line 107, in _is_separating_line
    (len(row) >= 1 and row[0] == SEPARATING_LINE)
  File "/home/user/miniconda3/envs/HAMLET/lib/python3.10/site-packages/snakemake/rules.py", line 1222, in __eq__
    return self.name == other.name and self.output == other.output
AttributeError: 'str' object has no attribute 'name'

Minimal example

rule all:
    input: "test.out"

rule make_out:
    output: "test.out"
    shell: "touch {output}"

Additional context

@Redmar-van-den-Berg Redmar-van-den-Berg added the bug Something isn't working label Oct 7, 2022
@karl-az
Copy link

karl-az commented Oct 7, 2022

Happens on my system as well

@descostesn
Copy link

it is happening to everybody I guess

@karl-az
Copy link

karl-az commented Oct 7, 2022

Tried to roll back to older versions. Could it be the new release of tabulate: https://pypi.org/project/tabulate/#history?

Edit: Downgrading to tabulate 0.8.10 resolved the issue for me

@ftabaro
Copy link

ftabaro commented Oct 7, 2022

See issue #1891

@nh13
Copy link
Contributor

nh13 commented Oct 7, 2022

hitting this as well

@vsmalladi
Copy link

Hit this as well.

@standage
Copy link

standage commented Oct 7, 2022

Yep

johanneskoester added a commit that referenced this issue Oct 8, 2022
…late package (#1898)

* fixes #1892
* fixes #1891

Thanks to @ftabaro for pointing me to the problem and providing an
initial solution (#1893).

### QC
<!-- Make sure that you can tick the boxes below. -->

* [x] The PR contains a test case for the changes or the changes are
already covered by an existing test case.
* [x] The documentation (`docs/`) is updated to reflect the changes or
this is not necessary (e.g. if the change does neither modify the
language nor the behavior or functionalities of Snakemake).
johanneskoester pushed a commit that referenced this issue Oct 8, 2022
### Description

Fixes #1891 and #1892. The issue is that the [`__eq__` method of
`Rule`](https://github.com/snakemake/snakemake/blob/274d613fd27b632d5bbe4c6fe55a82262d6b2dec/snakemake/rules.py#L1221)
implicitly expects `other` to be an instance of `Rule` as well. Thus,
any comparison of a `Rule` instance to any non-`Rule` object leads to an
`AttributeError`. This is a more general fix than #1893.

### QC

* [x] The PR contains a test case for the changes or the changes are
already covered by an existing test case.
* [x] The documentation (`docs/`) is updated to reflect the changes or
this is not necessary (e.g. if the change does neither modify the
language nor the behavior or functionalities of Snakemake).
dariober added a commit to glaParaBio/genomeAnnotationPipeline that referenced this issue Oct 10, 2022
dariober added a commit to glaParaBio/genetic-variant-detection-in-cell-pops that referenced this issue Oct 10, 2022
ilveroluca added a commit to crs4/fair-crcc-get-data that referenced this issue Oct 27, 2022
ilveroluca added a commit to crs4/fair-crcc-get-data that referenced this issue Oct 27, 2022
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
7 participants