Skip to content

Commit

Permalink
Merge pull request #456 from ncihtan/aditigopalan-patch-1
Browse files Browse the repository at this point in the history
Update ci-lint-validate-convert.yml
  • Loading branch information
aditigopalan authored Sep 11, 2024
2 parents 1b69fc1 + 962b4f6 commit 28a467b
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/ci-lint-validate-convert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,22 +122,20 @@ jobs:
url = "https://schematic.api.sagebionetworks.org/v1/visualize/attributes"
jsonld_url = "https://raw.githubusercontent.com/ncihtan/data-models/main/HTAN.model.jsonld"
# Prepare parameters or request body as needed
params = {'schema_url': jsonld_url}
print("Fetching attribute table...")
# Change to POST if required by the API
response = requests.post(url, params=params)
response = requests.get(url, params=params)
print(f"Status Code: {response.status_code}")
print(f"Response Text: {response.text[:500]}") # Print first 500 characters for review
if response.status_code == 200:
content_type = response.headers.get('Content-Type', '')
if 'text/html' in content_type:
print("Response in text/html format, converting to CSV...")
try:
df = pd.read_csv(StringIO(response.text))
print("Fetched attribute table.")
df.to_csv('HTAN.dependencies.csv', index=False)
print("Saved to HTAN.dependencies.csv.")
except Exception as e:
Expand All @@ -146,11 +144,9 @@ jobs:
print("Unexpected content type. Expected text/html but got:", content_type)
else:
print(f"Failed to fetch data. Status Code: {response.status_code}")
if __name__ == "__main__":
fetch_and_save_attribute_table()
EOF
fetch_and_save_attribute_table()
EOF
- name: Commit changes
run: |
Expand Down

0 comments on commit 28a467b

Please sign in to comment.