coveralls: ## Pull Request Test Coverage Report for [Build 1138](https://coveralls.io/builds/25867385)

* **2** of **2**   **(100.0%)**  changed or added relevant lines in **1** file are covered.
* No unchanged relevant lines lost coverage.
* Overall coverage remained the same at **96.943%**

---



|  Totals | [![Coverage Status](https://coveralls.io/builds/25867385/badge)](https://coveralls.io/builds/25867385) |
| :-- | --: |
| Change from base [Build 1129](https://coveralls.io/builds/25792618): |  0.0% |
| Covered Lines: | 4344 |
| Relevant Lines: | 4481 |

---
##### 💛  - [Coveralls](https://coveralls.io)

diff --git a/WDL/Expr.py b/WDL/Expr.py
index 40ec922..86b61ef 100644
--- a/WDL/Expr.py
+++ b/WDL/Expr.py
@@ -1031,9 +1031,9 @@ class Apply(Base):
             return "{} && {}".format(arguments[0], arguments[1])
         elif isinstance(func, StdLib._Or):
             return "{} || {}".format(arguments[0], arguments[1])
-        elif func.name == "_rem":
+        elif self.function_name == "_rem":
             return "{} % {}".format(arguments[0], arguments[1])
-        elif func.name == "_negate":
+        elif self.function_name == "_negate":
             return "!{}".format(arguments[0])
         else:
             return "{}({})".format(self.function_name, ",".join(arguments))

calling str() on some functions results in AttributeError: [...] object has no attribute 'name'
I just found a bug in my implementation of the `__str__` function for expressions (#215). For any functions which do not inherit the `StaticFunction` class the `name` attribute doesn't exist. Which will result in an error when calling `str` on (some of) these functions.

I am currently investigating how to solve this and will make a PR when I find a solution.
diff --git a/tests/test_0eval.py b/tests/test_0eval.py
index 4dbf499..2dcdee3 100644
--- a/tests/test_0eval.py
+++ b/tests/test_0eval.py
@@ -38,6 +38,7 @@ class TestEval(unittest.TestCase):
 
         # functions
         self.assertEqual(str(WDL.parse_expr("defined(value)")), "defined(value)")
+        self.assertEqual(str(WDL.parse_expr("select_first([1, 2])")), "select_first([1, 2])")
 
         # access
         self.assertEqual(str(WDL.parse_expr("[1,2][1]")), "[1, 2][1]")

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-cov pytest-xdist
apt-get update apt-get install -y gcc
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
argcomplete==3.6.1
certifi==2025.1.31
charset-normalizer==3.4.1
coloredlogs==15.0.1
coverage==7.8.0
docker==7.1.0
exceptiongroup==1.2.2
execnet==2.1.1
humanfriendly==10.0
idna==3.10
iniconfig==2.1.0
lark-parser==0.7.5
-e git+https://github.com/chanzuckerberg/miniwdl.git@db5214a93a9df0481af27360b481f9901cf897a1#egg=miniwdl
packaging==24.2
pluggy==1.5.0
pygtail==0.14.0
pytest==8.3.5
pytest-cov==6.0.0
pytest-xdist==3.6.1
requests==2.32.3
tomli==2.2.1
urllib3==2.3.0

name: miniwdl
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - argcomplete==3.6.1
      - certifi==2025.1.31
      - charset-normalizer==3.4.1
      - coloredlogs==15.0.1
      - coverage==7.8.0
      - docker==7.1.0
      - exceptiongroup==1.2.2
      - execnet==2.1.1
      - humanfriendly==10.0
      - idna==3.10
      - iniconfig==2.1.0
      - lark-parser==0.7.5
      - packaging==24.2
      - pluggy==1.5.0
      - pygtail==0.14.0
      - pytest==8.3.5
      - pytest-cov==6.0.0
      - pytest-xdist==3.6.1
      - requests==2.32.3
      - tomli==2.2.1
      - urllib3==2.3.0
prefix: /opt/conda/envs/miniwdl

tests/test_0eval.py::TestEval::test_expr_render
tests/test_0eval.py::TestEval::test_arithmetic tests/test_0eval.py::TestEval::test_array tests/test_0eval.py::TestEval::test_boolean tests/test_0eval.py::TestEval::test_cmp tests/test_0eval.py::TestEval::test_errors tests/test_0eval.py::TestEval::test_float_coercion tests/test_0eval.py::TestEval::test_ident tests/test_0eval.py::TestEval::test_if tests/test_0eval.py::TestEval::test_interpolation tests/test_0eval.py::TestEval::test_logic tests/test_0eval.py::TestEval::test_map tests/test_0eval.py::TestEval::test_pair tests/test_0eval.py::TestEval::test_short_circuit tests/test_0eval.py::TestEval::test_str tests/test_0eval.py::TestEnv::test_bind tests/test_0eval.py::TestEnv::test_namespaces tests/test_0eval.py::TestEnv::test_subtract tests/test_0eval.py::TestValue::test_env_json tests/test_0eval.py::TestValue::test_json
WDL/Expr.py
WDL/Expr.py