Skip to content

Commit

Permalink
Use dataclass to initialize default values
Browse files Browse the repository at this point in the history
  • Loading branch information
nuwang committed Feb 9, 2024
1 parent 02c5bd1 commit 720b678
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/galaxy/files/sources/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import abc
from dataclasses import dataclass, field
import os
import time
from enum import Enum
Expand Down Expand Up @@ -88,6 +89,7 @@ class FilesSourceProperties(TypedDict):
browsable: NotRequired[bool]


@dataclass
class FilesSourceOptions:
"""Options to control behavior of file source operations, such as realize_to, write_from and list."""

Expand All @@ -100,7 +102,7 @@ class FilesSourceOptions:
# the HTTPFilesSource passes in additional http_headers through these properties, which
# are merged with constructor defined http_headers. The interpretation of these properties
# are filesystem specific.
extra_props: Optional[FilesSourceProperties] = {}
extra_props: Optional[FilesSourceProperties] = field(default_factory=lambda: {})


class EntryData(TypedDict):
Expand Down

0 comments on commit 720b678

Please sign in to comment.