MCPcopy
hub / github.com/dlt-hub/dlt / clone

Method clone

dlt/extract/source.py:583–591  ·  view source on GitHub ↗

Creates a deep copy of the source where copies of schema, resources and pipes are created. If `with_name` is provided, a schema is cloned with a changed name

(self, with_name: str = None)

Source from the content-addressed store, hash-verified

581 return source_state()
582
583 def clone(self, with_name: str = None) -> "DltSource":
584 """Creates a deep copy of the source where copies of schema, resources and pipes are created.
585
586 If `with_name` is provided, a schema is cloned with a changed name
587 """
588 # mind that resources and pipes are cloned when added to the DltResourcesDict in the source constructor
589 return DltSource(
590 self.schema.clone(with_name=with_name), self.section, list(self._resources.values())
591 )
592
593 def __iter__(self) -> Generator[TDataItem, None, None]:
594 """Opens iterator that yields the data items from all the resources within the source in the same order as in Pipeline class.

Callers 15

with_resourcesMethod · 0.95
rest_api_sourceFunction · 0.45
discover_schemaMethod · 0.45
select_schemaFunction · 0.45
spool_schema_filesMethod · 0.45
_extract_sourceMethod · 0.45
__init__Method · 0.45
test_clone_sourceFunction · 0.45
_assert_valid_cloneFunction · 0.45

Calls 2

DltSourceClass · 0.85
valuesMethod · 0.80