-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from RohithSurya/features/readfile_docs_32199_…
…32200 WIP: [#32200] Commit show command, Move ReadFile getData API calls to JSON
- Loading branch information
Showing
19 changed files
with
1,260 additions
and
811 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
name: Test Coverage | ||
on: | ||
push: | ||
branches: | ||
main | ||
pull_request: | ||
branches: | ||
main | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,4 +133,6 @@ dmypy.json | |
tests/my_secret.py | ||
|
||
# Miscellaneous folders | ||
Dummy/ | ||
Dummy/ | ||
|
||
docs/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from pyhpcc.models.auth import Auth | ||
from pyhpcc.models.file import ReadFileInfo | ||
from pyhpcc.models.hpcc import HPCC | ||
|
||
# Code to check if a logical file exists | ||
|
||
# Configurations | ||
environment = ( | ||
"university.us-hpccsystems-dev.azure.lnrsg.io" # Eg: myuniversity.hpccsystems.io | ||
) | ||
port = "8010" # Eg: 8010 | ||
user_name = "dummyusername" # HPCC username | ||
password = "dummypassword" # HPCC password | ||
protocol = "http" # Specify HTTP or HTTPS p | ||
cluster = "thor" # Specify the cluster name to be used | ||
logical_file = "pyhpcc::testing::internet.csv" | ||
|
||
try: | ||
auth_object = Auth( | ||
environment, | ||
port, | ||
user_name, | ||
password, | ||
protocol=protocol, | ||
) | ||
hpcc_object = HPCC(auth=auth_object) | ||
read_file = ReadFileInfo( | ||
hpcc=hpcc_object, | ||
logical_file_name=logical_file, | ||
cluster=cluster, | ||
file_type="flat", | ||
) | ||
|
||
print(read_file.check_file_in_dfu()) # Prints `True` if file exists else `False` | ||
|
||
except Exception as e: | ||
print(e) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from pyhpcc.models.auth import Auth | ||
from pyhpcc.models.file import ReadFileInfo | ||
from pyhpcc.models.hpcc import HPCC | ||
|
||
# Example illustrating how to read a logical file | ||
|
||
# Configurations | ||
environment = ( | ||
"university.us-hpccsystems-dev.azure.lnrsg.io" # Eg: myuniversity.hpccsystems.io | ||
) | ||
port = "8010" # Eg: 8010 | ||
user_name = "dummy username" # HPCC username | ||
password = "password" # HPCC password | ||
protocol = "http" # Specify HTTP or HTTPS p | ||
cluster = "thor" # Specify the cluster name to be used | ||
logical_file = "pyhpcc::em::test::emp" | ||
|
||
try: | ||
auth_object = Auth( | ||
environment, | ||
port, | ||
user_name, | ||
password, | ||
protocol=protocol, | ||
) | ||
hpcc_object = HPCC(auth=auth_object) | ||
read_file = ReadFileInfo(hpcc=hpcc_object, logical_file_name=logical_file) | ||
|
||
# Retrieves all records with a `batch_size` of 2. To retrieve all records in one go, set the batch_size to a large number | ||
for data_attr, data in read_file.get_data_iter(0, -1, 2): | ||
print(data_attr) | ||
print(data) | ||
|
||
except Exception as e: | ||
print(e) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.