Skip to content

Commit 2ac9248

Browse files
committed
Pull up {Simple,TDR}SourceSpec.name into superclass
1 parent d7e2ee8 commit 2ac9248

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/azul/indexer/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,14 +423,14 @@ class SourceSpec(Parseable, metaclass=ABCMeta):
423423
are structured might want to implement this abstract class. Plugins that
424424
have simple unstructured names may want to use :class:`SimpleSourceSpec`.
425425
"""
426+
name: str
426427

427428

428429
@attrs.frozen(kw_only=True)
429430
class SimpleSourceSpec(SourceSpec):
430431
"""
431432
Default implementation for unstructured source names.
432433
"""
433-
name: str
434434

435435
@classmethod
436436
def parse(cls, spec: str) -> Self:

src/azul/terra.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ class Domain(StrEnum):
123123
type: Type
124124
domain: Domain
125125
subdomain: str
126-
name: str
127126

128127
@classmethod
129128
def parse(cls, spec: str) -> Self:
@@ -133,10 +132,10 @@ def parse(cls, spec: str) -> Self:
133132
134133
>>> s = TDRSourceSpec.parse('tdr:bigquery:gcp:foo:bar')
135134
>>> s # doctest: +NORMALIZE_WHITESPACE
136-
TDRSourceSpec(type=<Type.bigquery: 'bigquery'>,
135+
TDRSourceSpec(name='bar',
136+
type=<Type.bigquery: 'bigquery'>,
137137
domain=<Domain.gcp: 'gcp'>,
138-
subdomain='foo',
139-
name='bar')
138+
subdomain='foo')
140139
141140
>>> str(s)
142141
'tdr:bigquery:gcp:foo:bar'

0 commit comments

Comments
 (0)