Skip to content

Commit 962fb1d

Browse files
committed
Convert RenderMediaProgress to dataclass
1 parent b5e650f commit 962fb1d

File tree

1 file changed

+19
-19
lines changed
  • packages/lambda-python/remotion_lambda

1 file changed

+19
-19
lines changed

packages/lambda-python/remotion_lambda/models.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# pylint: disable=too-few-public-methods, missing-module-docstring, broad-exception-caught,invalid-name
22

33
from enum import Enum
4-
from typing import Optional, Dict, Any, Union, Literal
4+
from typing import Optional, Dict, Any, Union, Literal, List
55
from dataclasses import dataclass, field
66
from .version import VERSION
77

@@ -534,26 +534,26 @@ class RenderStillResponse:
534534
outKey: str
535535

536536

537+
@dataclass
537538
class RenderMediaProgress:
538539
"""
539540
Progress of video rendering.
540541
"""
541542

542-
def __init__(self):
543-
self.overallProgress = float()
544-
self.chunks = int()
545-
self.done = bool()
546-
self.encodingStatus = None
547-
self.costs = None
548-
self.renderId = str()
549-
self.renderMetadata = None
550-
self.outputFile = None
551-
self.outKey = None
552-
self.timeToFinish = None
553-
self.errors = []
554-
self.fatalErrorEncountered = bool()
555-
self.currentTime = int()
556-
self.renderSize = int()
557-
self.outputSizeInBytes = None
558-
self.lambdasInvoked = int()
559-
self.framesRendered = None
543+
overallProgress: float = 0.0
544+
chunks: int = 0
545+
done: bool = False
546+
encodingStatus: Optional[Any] = None
547+
costs: Optional[Any] = None
548+
renderId: str = ""
549+
renderMetadata: Optional[Any] = None
550+
outputFile: Optional[Any] = None
551+
outKey: Optional[str] = None
552+
timeToFinish: Optional[float] = None
553+
errors: List[Any] = field(default_factory=list)
554+
fatalErrorEncountered: bool = False
555+
currentTime: int = 0
556+
renderSize: int = 0
557+
outputSizeInBytes: Optional[int] = None
558+
lambdasInvoked: int = 0
559+
framesRendered: Optional[int] = None

0 commit comments

Comments
 (0)