prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  [CT-3210] [Bug] Error using `dbt list --select` when there is a cross-project model that is `version=0` in the parent project
  ### Is this a new bug in dbt-core?
  
  - [X] I believe this is a new bug in dbt-core
  - [X] I have searched the existing issues, and I could not find an existing issue for this bug
  
  ### Current Behavior
  
  When you attempt to reference a model version 0, you get a stack trace error.
  
  
  
  ### Expected Behavior
  
  We should allow you to set model version to be 0.
  
  ### Steps To Reproduce
  
  1. On parent/hub project, add a versioned model with `v: 0`
  2. On the child/spoke project, attempt to reference that versioned model in a model:
    `select * from {{ ref('example_hub', 'my_second_dbt_model', v=0) }}`
  3. run `dbt list --select anything`
  
  Outstanding question - is this only affecting cross-project refs? Or all refs to a model with `v: 0`?
  
  ### Relevant log output
  
  _No response_
  
  ### Environment
  
  ```markdown
  - OS:
  - Python:
  - dbt:
  ```
  
  
  ### Which database adapter are you using with dbt?
  
  _No response_
  
  ### Additional Context
  
  _No response_
  
  </issue>
  <code>
  [start of core/dbt/contracts/graph/node_args.py]
  1 from dataclasses import dataclass, field
  2 from datetime import datetime
  3 from typing import Optional, List
  4 
  5 from dbt.contracts.graph.unparsed import NodeVersion
  6 from dbt.node_types import NodeType, AccessType
  7 
  8 
  9 @dataclass
  10 class ModelNodeArgs:
  11     name: str
  12     package_name: str
  13     identifier: str
  14     schema: str
  15     database: Optional[str] = None
  16     relation_name: Optional[str] = None
  17     version: Optional[NodeVersion] = None
  18     latest_version: Optional[NodeVersion] = None
  19     deprecation_date: Optional[datetime] = None
  20     access: Optional[str] = AccessType.Protected.value
  21     generated_at: datetime = field(default_factory=datetime.utcnow)
  22     depends_on_nodes: List[str] = field(default_factory=list)
  23     enabled: bool = True
  24 
  25     @property
  26     def unique_id(self) -> str:
  27         unique_id = f"{NodeType.Model}.{self.package_name}.{self.name}"
  28         if self.version:
  29             unique_id = f"{unique_id}.v{self.version}"
  30 
  31         return unique_id
  32 
  33     @property
  34     def fqn(self) -> List[str]:
  35         fqn = [self.package_name, self.name]
  36         if self.version:
  37             fqn.append(f"v{self.version}")
  38 
  39         return fqn
  40
  [end of core/dbt/contracts/graph/node_args.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/core/dbt/contracts/graph/node_args.py b/core/dbt/contracts/graph/node_args.py
  --- a/core/dbt/contracts/graph/node_args.py
  +++ b/core/dbt/contracts/graph/node_args.py
  @@ -33,7 +33,8 @@
       @property
       def fqn(self) -> List[str]:
           fqn = [self.package_name, self.name]
  -        if self.version:
  +        # Test for None explicitly because version can be 0
  +        if self.version is not None:
               fqn.append(f"v{self.version}")
   
           return fqn
  
verification_info: {"golden_diff": "diff --git a/core/dbt/contracts/graph/node_args.py b/core/dbt/contracts/graph/node_args.py\n--- a/core/dbt/contracts/graph/node_args.py\n+++ b/core/dbt/contracts/graph/node_args.py\n@@ -33,7 +33,8 @@\n     @property\n     def fqn(self) -> List[str]:\n         fqn = [self.package_name, self.name]\n-        if self.version:\n+        # Test for None explicitly because version can be 0\n+        if self.version is not None:\n             fqn.append(f\"v{self.version}\")\n \n         return fqn\n", "issue": "[CT-3210] [Bug] Error using `dbt list --select` when there is a cross-project model that is `version=0` in the parent project\n### Is this a new bug in dbt-core?\r\n\r\n- [X] I believe this is a new bug in dbt-core\r\n- [X] I have searched the existing issues, and I could not find an existing issue for this bug\r\n\r\n### Current Behavior\r\n\r\nWhen you attempt to reference a model version 0, you get a stack trace error.\r\n\r\n\r\n\r\n### Expected Behavior\r\n\r\nWe should allow you to set model version to be 0.\r\n\r\n### Steps To Reproduce\r\n\r\n1. On parent/hub project, add a versioned model with `v: 0`\r\n2. On the child/spoke project, attempt to reference that versioned model in a model:\r\n  `select * from {{ ref('example_hub', 'my_second_dbt_model', v=0) }}`\r\n3. run `dbt list --select anything`\r\n\r\nOutstanding question - is this only affecting cross-project refs? Or all refs to a model with `v: 0`?\r\n\r\n### Relevant log output\r\n\r\n_No response_\r\n\r\n### Environment\r\n\r\n```markdown\r\n- OS:\r\n- Python:\r\n- dbt:\r\n```\r\n\r\n\r\n### Which database adapter are you using with dbt?\r\n\r\n_No response_\r\n\r\n### Additional Context\r\n\r\n_No response_\n", "before_files": [{"content": "from dataclasses import dataclass, field\nfrom datetime import datetime\nfrom typing import Optional, List\n\nfrom dbt.contracts.graph.unparsed import NodeVersion\nfrom dbt.node_types import NodeType, AccessType\n\n\n@dataclass\nclass ModelNodeArgs:\n    name: str\n    package_name: str\n    identifier: str\n    schema: str\n    database: Optional[str] = None\n    relation_name: Optional[str] = None\n    version: Optional[NodeVersion] = None\n    latest_version: Optional[NodeVersion] = None\n    deprecation_date: Optional[datetime] = None\n    access: Optional[str] = AccessType.Protected.value\n    generated_at: datetime = field(default_factory=datetime.utcnow)\n    depends_on_nodes: List[str] = field(default_factory=list)\n    enabled: bool = True\n\n    @property\n    def unique_id(self) -> str:\n        unique_id = f\"{NodeType.Model}.{self.package_name}.{self.name}\"\n        if self.version:\n            unique_id = f\"{unique_id}.v{self.version}\"\n\n        return unique_id\n\n    @property\n    def fqn(self) -> List[str]:\n        fqn = [self.package_name, self.name]\n        if self.version:\n            fqn.append(f\"v{self.version}\")\n\n        return fqn\n", "path": "core/dbt/contracts/graph/node_args.py"}]}