Adding username and password into the configs
#1
by
rajistics
- opened
- snowflaketest.py +18 -3
snowflaketest.py
CHANGED
@@ -28,11 +28,24 @@ _HOMEPAGE = ""
|
|
28 |
# TODO: Add the licence for the dataset here if you can find it
|
29 |
_LICENSE = ""
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
-
# TODO: Name of the dataset usually match the script name with CamelCase instead of snake_case
|
33 |
class NewDataset(datasets.GeneratorBasedBuilder):
|
34 |
"""TODO: Short description of my dataset."""
|
35 |
|
|
|
|
|
36 |
def _info(self):
|
37 |
return datasets.DatasetInfo(
|
38 |
description=_DESCRIPTION,
|
@@ -49,9 +62,11 @@ class NewDataset(datasets.GeneratorBasedBuilder):
|
|
49 |
|
50 |
def _split_generators(self, dl_manager):
|
51 |
|
|
|
|
|
52 |
conn = connector.connect(
|
53 |
-
user=
|
54 |
-
password=
|
55 |
account='VUA92284',
|
56 |
warehouse='RAJIV',
|
57 |
database='HUGGINGFACE',
|
|
|
28 |
# TODO: Add the licence for the dataset here if you can find it
|
29 |
_LICENSE = ""
|
30 |
|
31 |
+
class LoginConfig(datasets.BuilderConfig):
|
32 |
+
"""BuilderConfig for Login."""
|
33 |
+
def __init__(self, username, password, **kwargs):
|
34 |
+
"""BuilderConfig for SuperGLUE.
|
35 |
+
Args:
|
36 |
+
username: `string`, User name in Snowflake
|
37 |
+
password: `string`, Snowflake password.
|
38 |
+
**kwargs: keyword arguments forwarded to super.
|
39 |
+
"""
|
40 |
+
super(LoginConfig, self).__init__(version=datasets.Version("1.0.2"), **kwargs)
|
41 |
+
self.username = username
|
42 |
+
self.password = password
|
43 |
|
|
|
44 |
class NewDataset(datasets.GeneratorBasedBuilder):
|
45 |
"""TODO: Short description of my dataset."""
|
46 |
|
47 |
+
BUILDER_CONFIG_CLASS = LoginConfig
|
48 |
+
|
49 |
def _info(self):
|
50 |
return datasets.DatasetInfo(
|
51 |
description=_DESCRIPTION,
|
|
|
62 |
|
63 |
def _split_generators(self, dl_manager):
|
64 |
|
65 |
+
user = self.config.username
|
66 |
+
password = self.config.password
|
67 |
conn = connector.connect(
|
68 |
+
user=user,
|
69 |
+
password=password,
|
70 |
account='VUA92284',
|
71 |
warehouse='RAJIV',
|
72 |
database='HUGGINGFACE',
|