Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
HomeAssistant
Core
Commits
3df91cfb
Unverified
Commit
3df91cfb
authored
2 months ago
by
Marc Mueller
Committed by
GitHub
2 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix method subtyping [recorder] (#134212)
parent
d3fab42c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
homeassistant/components/recorder/db_schema.py
+6
-2
6 additions, 2 deletions
homeassistant/components/recorder/db_schema.py
homeassistant/components/recorder/migration.py
+1
-1
1 addition, 1 deletion
homeassistant/components/recorder/migration.py
with
7 additions
and
3 deletions
homeassistant/components/recorder/db_schema.py
+
6
−
2
View file @
3df91cfb
...
@@ -6,7 +6,7 @@ from collections.abc import Callable
...
@@ -6,7 +6,7 @@ from collections.abc import Callable
from
datetime
import
datetime
,
timedelta
from
datetime
import
datetime
,
timedelta
import
logging
import
logging
import
time
import
time
from
typing
import
Any
,
Final
,
Self
,
cast
from
typing
import
Any
,
Final
,
Protocol
,
Self
,
cast
import
ciso8601
import
ciso8601
from
fnv_hash_fast
import
fnv1a_32
from
fnv_hash_fast
import
fnv1a_32
...
@@ -233,10 +233,14 @@ CONTEXT_BINARY_TYPE = LargeBinary(CONTEXT_ID_BIN_MAX_LENGTH).with_variant(
...
@@ -233,10 +233,14 @@ CONTEXT_BINARY_TYPE = LargeBinary(CONTEXT_ID_BIN_MAX_LENGTH).with_variant(
TIMESTAMP_TYPE
=
DOUBLE_TYPE
TIMESTAMP_TYPE
=
DOUBLE_TYPE
class
_LiteralProcessorType
(
Protocol
):
def
__call__
(
self
,
value
:
Any
)
->
str
:
...
class
JSONLiteral
(
JSON
):
class
JSONLiteral
(
JSON
):
"""
Teach SA how to literalize json.
"""
"""
Teach SA how to literalize json.
"""
def
literal_processor
(
self
,
dialect
:
Dialect
)
->
Callable
[[
Any
],
str
]
:
def
literal_processor
(
self
,
dialect
:
Dialect
)
->
_LiteralProcessorType
:
"""
Processor to convert a value to JSON.
"""
"""
Processor to convert a value to JSON.
"""
def
process
(
value
:
Any
)
->
str
:
def
process
(
value
:
Any
)
->
str
:
...
...
This diff is collapsed.
Click to expand it.
homeassistant/components/recorder/migration.py
+
1
−
1
View file @
3df91cfb
...
@@ -2453,7 +2453,7 @@ class BaseMigration(ABC):
...
@@ -2453,7 +2453,7 @@ class BaseMigration(ABC):
self
.
migration_changes
=
migration_changes
self
.
migration_changes
=
migration_changes
@abstractmethod
@abstractmethod
def
migrate_data
(
self
,
instance
:
Recorder
)
->
bool
:
def
migrate_data
(
self
,
instance
:
Recorder
,
/
)
->
bool
:
"""
Migrate some data, return True if migration is completed.
"""
"""
Migrate some data, return True if migration is completed.
"""
def
_migrate_data
(
self
,
instance
:
Recorder
)
->
bool
:
def
_migrate_data
(
self
,
instance
:
Recorder
)
->
bool
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment