Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suppress both the index and the index column of the data_frame in output #51

Merged
merged 1 commit into from
Jun 2, 2022
Merged

Conversation

tkishel
Copy link
Contributor

@tkishel tkishel commented Jun 2, 2022

Description

Suppress both the index and the index column of the data_frame in output.

Motivation and Context

The indexes are not part of the data returned by the APIs, rather they are an artifact of pandas.

How Has This Been Tested?

Before:

# pc --output text settings
      index    disconnectPeriodDays    listeningPort  admissionControlEnabled    admissionControlWebhookSuffix    hostCustomComplianceEnabled    automaticUpgrade
--  -------  ----------------------  ---------------  -------------------------  -------------------------------  -----------------------------  ------------------
 0        0                       1             9998  True                       8is8ilgnnl579305k25ic4mfi...     True                           False

After:

# pc --output text settings
  disconnectPeriodDays    listeningPort  admissionControlEnabled    admissionControlWebhookSuffix    hostCustomComplianceEnabled    automaticUpgrade
----------------------  ---------------  -------------------------  -------------------------------  -----------------------------  ------------------
                     1             9998  True                       8is8ilgnnl579305k25ic4mfi...     True                           False

And for other formats:

# pc --output csv settings
disconnectPeriodDays,listeningPort,admissionControlEnabled,admissionControlWebhookSuffix,hostCustomComplianceEnabled,automaticUpgrade
1,9998,True,8is8ilgnnl579305k25ic4mfirfz,True,False


# pc --output json settings
[{"disconnectPeriodDays":"1","listeningPort":"9998","admissionControlEnabled":"True","admissionControlWebhookSuffix":"8is8ilgnnl579305k25ic4mfirfz","hostCustomComplianceEnabled":"True","automaticUpgrade":"False"}]


# pc --output json settings | jq
[
  {
    "disconnectPeriodDays": "1",
    "listeningPort": "9998",
    "admissionControlEnabled": "True",
    "admissionControlWebhookSuffix": "8is8ilgnnl579305k25ic4mfirfz",
    "hostCustomComplianceEnabled": "True",
    "automaticUpgrade": "False"
  }
]


# pc --output html settings
<html>
<head>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
</head>
                
<table border="1" class="dataframe table table-sm table-striped text-left">
  <thead>
    <tr style="text-align: left;">
      <th>disconnectPeriodDays</th>
      <th>listeningPort</th>
      <th>admissionControlEnabled</th>
      <th>admissionControlWebhookSuffix</th>
      <th>hostCustomComplianceEnabled</th>
      <th>automaticUpgrade</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>1</td>
      <td>9998</td>
      <td>True</td>
      <td>8is8ilgnnl579305k25ic4mfirfz</td>
      <td>True</td>
      <td>False</td>
    </tr>
  </tbody>
</table>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
</html>

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes if appropriate.
  • All new and existing tests passed.

@welcome-to-palo-alto-networks
Copy link

🎉 Thanks for opening this pull request! We really appreciate contributors like you! 🙌

Copy link
Contributor

@steven-deboer steven-deboer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Tom!!!

@steven-deboer steven-deboer merged commit a83b2fc into PaloAltoNetworks:main Jun 2, 2022
@welcome-to-palo-alto-networks
Copy link

🎉 Congrats on getting your first pull request merged! We here at Palo Alto Networks are so grateful! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants