Skip to content

Commit cee9063

Browse files
Migrate away from deprecated quirk_docs decorator.
1 parent 89c9f06 commit cee9063

File tree

8 files changed

+47
-47
lines changed

8 files changed

+47
-47
lines changed

omniduct/caches/base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import pandas
77
import yaml
88
from decorator import decorator
9-
from interface_meta import quirk_docs
9+
from interface_meta import inherit_docs
1010

1111
from omniduct.duct import Duct
1212
from omniduct.utils.config import config
@@ -134,7 +134,7 @@ class Cache(Duct):
134134

135135
DUCT_TYPE = Duct.Type.CACHE
136136

137-
@quirk_docs("_init", mro=True)
137+
@inherit_docs("_init", mro=True)
138138
def __init__(self, **kwargs): # pylint: disable=super-init-not-called
139139
Duct.__init_with_kwargs__(self, kwargs)
140140
self._init(**kwargs)

omniduct/databases/base.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import jinja2.meta
1212
import sqlparse
1313
from decorator import decorator
14-
from interface_meta import quirk_docs, override
14+
from interface_meta import inherit_docs, override
1515

1616
from omniduct.caches.base import cached_method
1717
from omniduct.duct import Duct
@@ -96,7 +96,7 @@ def NAMESPACE_DEFAULTS_WRITE(self):
9696
"""
9797
return self.NAMESPACE_DEFAULTS_READ
9898

99-
@quirk_docs("_init", mro=True)
99+
@inherit_docs("_init", mro=True)
100100
# pylint: disable-next=super-init-not-called
101101
def __init__(
102102
self,
@@ -268,7 +268,7 @@ def statement_cleanup(cls, statement):
268268
"session_properties": kwargs["session_properties"],
269269
},
270270
)
271-
@quirk_docs("_execute")
271+
@inherit_docs("_execute")
272272
@require_connection
273273
def execute(
274274
self, statement, wait=True, cursor=None, session_properties=None, **kwargs
@@ -710,7 +710,7 @@ def query_from_template(self, name, context=None, **kwargs):
710710

711711
# Uploading/querying data into data store
712712
@logging_scope("Query [CTAS]", timed=True)
713-
@quirk_docs("_query_to_table")
713+
@inherit_docs("_query_to_table")
714714
def query_to_table(self, statement, table, if_exists="fail", **kwargs):
715715
"""
716716
Run a query and store the results in a table in this database.
@@ -734,7 +734,7 @@ def query_to_table(self, statement, table, if_exists="fail", **kwargs):
734734
return self._query_to_table(statement, table, if_exists=if_exists, **kwargs)
735735

736736
@logging_scope("Dataframe Upload", timed=True)
737-
@quirk_docs("_dataframe_to_table")
737+
@inherit_docs("_dataframe_to_table")
738738
@require_connection
739739
def dataframe_to_table(self, df, table, if_exists="fail", **kwargs):
740740
"""
@@ -784,7 +784,7 @@ def _parse_namespaces(self, name, level=0, defaults=None, write=False):
784784
),
785785
)
786786

787-
@quirk_docs("_table_list")
787+
@inherit_docs("_table_list")
788788
def table_list(self, namespace=None, renew=True, **kwargs):
789789
"""
790790
Return a list of table names in the data source as a DataFrame.
@@ -806,7 +806,7 @@ def table_list(self, namespace=None, renew=True, **kwargs):
806806
def _table_list(self, namespace, **kwargs):
807807
pass
808808

809-
@quirk_docs("_table_exists")
809+
@inherit_docs("_table_exists")
810810
def table_exists(self, table, renew=True, **kwargs):
811811
"""
812812
Check whether a table exists.
@@ -828,7 +828,7 @@ def table_exists(self, table, renew=True, **kwargs):
828828
def _table_exists(self, table, **kwargs):
829829
pass
830830

831-
@quirk_docs("_table_drop")
831+
@inherit_docs("_table_drop")
832832
def table_drop(self, table, **kwargs):
833833
"""
834834
Remove a table from the database.
@@ -848,7 +848,7 @@ def table_drop(self, table, **kwargs):
848848
def _table_drop(self, table, **kwargs):
849849
pass
850850

851-
@quirk_docs("_table_desc")
851+
@inherit_docs("_table_desc")
852852
def table_desc(self, table, renew=True, **kwargs):
853853
"""
854854
Describe a table in the database.
@@ -869,7 +869,7 @@ def table_desc(self, table, renew=True, **kwargs):
869869
def _table_desc(self, table, **kwargs):
870870
pass
871871

872-
@quirk_docs("_table_partition_cols")
872+
@inherit_docs("_table_partition_cols")
873873
def table_partition_cols(self, table, renew=True, **kwargs):
874874
"""
875875
Extract the columns by which a table is partitioned (if database supports partitions).
@@ -891,7 +891,7 @@ def _table_partition_cols(self, table, **kwargs):
891891
f"Database backend `{self.__class__.__name__}` does not support, or has not implemented, support for extracting partition columns."
892892
)
893893

894-
@quirk_docs("_table_head")
894+
@inherit_docs("_table_head")
895895
def table_head(self, table, n=10, renew=True, **kwargs):
896896
"""
897897
Retrieve the first `n` rows from a table.
@@ -915,7 +915,7 @@ def table_head(self, table, n=10, renew=True, **kwargs):
915915
def _table_head(self, table, n=10, **kwargs):
916916
pass
917917

918-
@quirk_docs("_table_props")
918+
@inherit_docs("_table_props")
919919
def table_props(self, table, renew=True, **kwargs):
920920
"""
921921
Retrieve the properties associated with a table.

omniduct/duct.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from builtins import input
1010
from enum import Enum
1111

12-
from interface_meta import InterfaceMeta, quirk_docs
12+
from interface_meta import InterfaceMeta, inherit_docs
1313

1414
from omniduct.errors import DuctProtocolUnknown, DuctServerUnreachable
1515
from omniduct.utils.debug import logger, logging_scope
@@ -261,7 +261,7 @@ def __setattr__(self, key, value):
261261
pass
262262
object.__setattr__(self, key, value)
263263

264-
@quirk_docs("_prepare")
264+
@inherit_docs("_prepare")
265265
def prepare(self):
266266
"""
267267
Prepare a Duct subclass for use (if not already prepared).
@@ -476,7 +476,7 @@ def __assert_server_reachable(self):
476476

477477
# Connection
478478
@logging_scope("Connecting")
479-
@quirk_docs("_connect")
479+
@inherit_docs("_connect")
480480
def connect(self):
481481
"""
482482
Connect to the service backing this client.
@@ -511,7 +511,7 @@ def connect(self):
511511
def _connect(self):
512512
raise NotImplementedError
513513

514-
@quirk_docs("_is_connected")
514+
@inherit_docs("_is_connected")
515515
def is_connected(self):
516516
"""
517517
Check whether this `Duct` instances is currently connected.
@@ -540,7 +540,7 @@ def is_connected(self):
540540
def _is_connected(self):
541541
raise NotImplementedError
542542

543-
@quirk_docs("_disconnect")
543+
@inherit_docs("_disconnect")
544544
def disconnect(self):
545545
"""
546546
Disconnect this client from backing service.

omniduct/filesystems/base.py

+17-17
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from collections import OrderedDict, namedtuple
44

55
import pandas as pd
6-
from interface_meta import quirk_docs, override
6+
from interface_meta import inherit_docs, override
77

88
from omniduct.duct import Duct
99
from omniduct.utils.decorators import require_connection
@@ -23,7 +23,7 @@ class FileSystemClient(Duct, MagicsProvider):
2323
DUCT_TYPE = Duct.Type.FILESYSTEM
2424
DEFAULT_PORT = None
2525

26-
@quirk_docs("_init", mro=True)
26+
@inherit_docs("_init", mro=True)
2727
def __init__( # pylint: disable=super-init-not-called
2828
self, cwd=None, home=None, read_only=False, global_writes=False, **kwargs
2929
):
@@ -53,7 +53,7 @@ def _init(self):
5353
# Path properties and helpers
5454

5555
@property
56-
@quirk_docs("_path_home")
56+
@inherit_docs("_path_home")
5757
@require_connection
5858
def path_home(self):
5959
"""
@@ -96,7 +96,7 @@ def path_cwd(self, path_cwd):
9696
self._path_cwd = path_cwd
9797

9898
@property
99-
@quirk_docs("_path_separator")
99+
@inherit_docs("_path_separator")
100100
def path_separator(self):
101101
"""
102102
str: The character(s) to use in separating path components. Typically
@@ -248,7 +248,7 @@ def _assert_path_is_writable(self, path):
248248

249249
# Filesystem accessors
250250

251-
@quirk_docs("_exists")
251+
@inherit_docs("_exists")
252252
@require_connection
253253
def exists(self, path):
254254
"""
@@ -267,7 +267,7 @@ def exists(self, path):
267267
def _exists(self, path):
268268
raise NotImplementedError
269269

270-
@quirk_docs("_isdir")
270+
@inherit_docs("_isdir")
271271
@require_connection
272272
def isdir(self, path):
273273
"""
@@ -286,7 +286,7 @@ def isdir(self, path):
286286
def _isdir(self, path):
287287
raise NotImplementedError
288288

289-
@quirk_docs("_isfile")
289+
@inherit_docs("_isfile")
290290
@require_connection
291291
def isfile(self, path):
292292
"""
@@ -313,7 +313,7 @@ def _dir(self, path):
313313
"""
314314
raise NotImplementedError
315315

316-
@quirk_docs("_dir")
316+
@inherit_docs("_dir")
317317
@require_connection
318318
def dir(self, path=None):
319319
"""
@@ -386,7 +386,7 @@ def _showdir(self, path):
386386
)
387387
return "Directory has no contents."
388388

389-
@quirk_docs("_walk")
389+
@inherit_docs("_walk")
390390
@require_connection
391391
def walk(self, path=None):
392392
"""
@@ -423,7 +423,7 @@ def _walk(self, path):
423423
): # Note: using _walk directly here, which may fail if disconnected during walk.
424424
yield walked
425425

426-
@quirk_docs("_find")
426+
@inherit_docs("_find")
427427
@require_connection
428428
def find(self, path_prefix=None, **attrs):
429429
"""
@@ -475,7 +475,7 @@ def is_match(f):
475475
): # Note: using _find directly here, which may fail if disconnected during find.
476476
yield match
477477

478-
@quirk_docs("_mkdir")
478+
@inherit_docs("_mkdir")
479479
@require_connection
480480
def mkdir(self, path, recursive=True, exist_ok=False):
481481
"""
@@ -498,7 +498,7 @@ def mkdir(self, path, recursive=True, exist_ok=False):
498498
def _mkdir(self, path, recursive, exist_ok):
499499
raise NotImplementedError
500500

501-
@quirk_docs("_remove")
501+
@inherit_docs("_remove")
502502
@require_connection
503503
def remove(self, path, recursive=False):
504504
"""
@@ -527,7 +527,7 @@ def _remove(self, path, recursive):
527527

528528
# File handling
529529

530-
@quirk_docs("_open")
530+
@inherit_docs("_open")
531531
@require_connection
532532
def open(self, path, mode="rt"):
533533
"""
@@ -553,7 +553,7 @@ def open(self, path, mode="rt"):
553553
def _open(self, path, mode):
554554
return FileSystemFile(self, path, mode)
555555

556-
@quirk_docs("_file_read_")
556+
@inherit_docs("_file_read_")
557557
@require_connection
558558
def _file_read(self, path, size=-1, offset=0, binary=False):
559559
"""
@@ -577,7 +577,7 @@ def _file_read(self, path, size=-1, offset=0, binary=False):
577577
def _file_read_(self, path, size=-1, offset=0, binary=False):
578578
raise NotImplementedError
579579

580-
@quirk_docs("_file_write_")
580+
@inherit_docs("_file_write_")
581581
@require_connection
582582
def _file_write(self, path, s, binary=False):
583583
"""
@@ -599,7 +599,7 @@ def _file_write(self, path, s, binary=False):
599599
def _file_write_(self, path, s, binary):
600600
raise NotImplementedError
601601

602-
@quirk_docs("_file_append_")
602+
@inherit_docs("_file_append_")
603603
@require_connection
604604
def _file_append(self, path, s, binary=False):
605605
"""
@@ -623,7 +623,7 @@ def _file_append_(self, path, s, binary):
623623

624624
# File transfer
625625

626-
@quirk_docs("_download")
626+
@inherit_docs("_download")
627627
def download(self, source, dest=None, overwrite=False, fs=None):
628628
"""
629629
Download files to another filesystem.

omniduct/remotes/base.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import re
33
from abc import abstractmethod
44

5-
from interface_meta import quirk_docs, override
5+
from interface_meta import inherit_docs, override
66

77
from omniduct.duct import Duct
88
from omniduct.errors import DuctAuthenticationError, DuctServerUnreachable
@@ -120,7 +120,7 @@ class RemoteClient(FileSystemClient):
120120
DUCT_TYPE = Duct.Type.REMOTE
121121
DEFAULT_PORT = None
122122

123-
@quirk_docs("_init", mro=True)
123+
@inherit_docs("_init", mro=True)
124124
def __init__(
125125
self, smartcards=None, **kwargs
126126
): # pylint: disable=super-init-not-called
@@ -217,7 +217,7 @@ def _prepare_smartcard(self, name, filename):
217217

218218
return True
219219

220-
@quirk_docs("_execute")
220+
@inherit_docs("_execute")
221221
@require_connection
222222
def execute(self, cmd, **kwargs):
223223
"""
@@ -264,7 +264,7 @@ def _extract_host_and_ports(self, remote_host, remote_port, local_port):
264264
port = m.group("port") or remote_port
265265
return host, port, local_port
266266

267-
@quirk_docs("_port_forward_start")
267+
@inherit_docs("_port_forward_start")
268268
@require_connection
269269
def port_forward(self, remote_host, remote_port=None, local_port=None):
270270
"""
@@ -354,7 +354,7 @@ def has_port_forward(self, remote_host=None, remote_port=None, local_port=None):
354354
)
355355
return self.__port_forwarding_register.reverse_lookup(local_port) is not None
356356

357-
@quirk_docs("_port_forward_stop")
357+
@inherit_docs("_port_forward_stop")
358358
def port_forward_stop(self, local_port=None, remote_host=None, remote_port=None):
359359
"""
360360
Disconnect an existing port forward connection.
@@ -447,7 +447,7 @@ def _port_forward_start(self, local_port, remote_host, remote_port):
447447
def _port_forward_stop(self, local_port, remote_host, remote_port, connection):
448448
raise NotImplementedError
449449

450-
@quirk_docs("_is_port_bound")
450+
@inherit_docs("_is_port_bound")
451451
@require_connection
452452
def is_port_bound(self, host, port):
453453
"""

omniduct/restful/base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import json
22
from urllib.parse import urljoin
33

4-
from interface_meta import quirk_docs, override
4+
from interface_meta import inherit_docs, override
55

66
from omniduct.duct import Duct
77
from omniduct.utils.decorators import require_connection
@@ -29,7 +29,7 @@ class RestClientBase(Duct):
2929

3030
DUCT_TYPE = Duct.Type.RESTFUL
3131

32-
@quirk_docs("_init", mro=True)
32+
@inherit_docs("_init", mro=True)
3333
def __init__( # pylint: disable=super-init-not-called
3434
self,
3535
server_protocol="http",

0 commit comments

Comments
 (0)