Skip to content

ruff F821 Undefined name types #1277

Closed as duplicate of#1274
Closed as duplicate of#1274
@leon1995

Description

@leon1995

Describe the bug
ruff fails after generating api

OpenAPI Spec File
https://apidoc.factorialhr.com/openapi/685ad94076e8c80063fae1c3

Desktop (please complete the following information):

  • OS: macos
  • Python Version: 3.13.1
  • openapi-python-client version: 0.25.1

Additional context

Error(s) encountered while generating, client was not created

ruff failed

factorial_api_client/models/post_api_20251001_resources_project_management_project_tasks_body.py:72:34: F821 Undefined name `types`
   |
70 |         subproject_id = self.subproject_id
71 |
72 |         files: Union[Unset, list[types.FileTypes]] = UNSET
   |                                  ^^^^^ F821
73 |         if not isinstance(self.files, Unset):
74 |             files = []
   |

factorial_api_client/models/put_api_20251001_resources_project_management_project_tasks_id_body.py:76:41: F821 Undefined name `types`
   |
74 |         subproject_id = self.subproject_id
75 |
76 |         files_to_add: Union[Unset, list[types.FileTypes]] = UNSET
   |                                         ^^^^^ F821                                                                                                                                                                                                
77 |         if not isinstance(self.files_to_add, Unset):                                                                                                                                                                                              
78 |             files_to_add = []                                                                                                                                                                                                                     
   |                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                       
factorial_api_client/models/put_api_20251001_resources_teams_teams_id_body.py:42:30: F821 Undefined name `types`                                                                                                                                       
   |                                                                                                                                                                                                                                                   
40 |         description = self.description                                                                                                                                                                                                            
41 |                                                                                                                                                                                                                                                   
42 |         avatar: Union[Unset, types.FileTypes] = UNSET                                                                                                                                                                                             
   |                              ^^^^^ F821                                                                                                                                                                                                           
43 |         if not isinstance(self.avatar, Unset):                                                                                                                                                                                                    
44 |             avatar = self.avatar.to_tuple()                                                                                                                                                                                                       
   |                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                       
Found 9035 errors (9032 fixed, 3 remaining). 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions