Skip to content

Commit

Permalink
fix: get current transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorentLvr committed Dec 21, 2023
1 parent 4dac0a7 commit 9121176
Showing 1 changed file with 9 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"tags": []
},
"source": [
"# Naas - Get Transactions\n",
"# Naas Credits - Get Transactions\n",
"<a href=\"https://app.naas.ai/user-redirect/naas/downloader?url=https://raw.githubusercontent.com/jupyter-naas/awesome-notebooks/master/Naas/Naas_Get_Transactions.ipynb\" target=\"_parent\"><img src=\"https://naasai-public.s3.eu-west-3.amazonaws.com/Open_in_Naas_Lab.svg\"/></a><br><br><a href=\"https://bit.ly/3JyWIk6\">Give Feedback</a> | <a href=\"https://github.com/jupyter-naas/awesome-notebooks/issues/new?assignees=&labels=bug&template=bug_report.md&title=Naas+-+Get+Transactions:+Error+short+description\">Bug report</a>"
]
},
Expand Down Expand Up @@ -60,7 +60,7 @@
"tags": []
},
"source": [
"**Last update:** 2023-04-12 (Created: 2021-11-17)"
"**Last update:** 2023-12-21 (Created: 2021-11-17)"
]
},
{
Expand Down Expand Up @@ -112,30 +112,6 @@
"import pandas as pd"
]
},
{
"cell_type": "markdown",
"id": "306bd842-b936-4eed-a173-f49dfdd09687",
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"### Variables"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "782b2a2b-ca0b-45e1-823f-c3abf3ac43cf",
"metadata": {
"papermill": {},
"tags": []
},
"outputs": [],
"source": [
"page_size = \"100000\""
]
},
{
"cell_type": "markdown",
"id": "registered-showcase",
Expand All @@ -155,7 +131,7 @@
"tags": []
},
"source": [
"### Function"
"### Get transactions"
]
},
{
Expand All @@ -168,8 +144,9 @@
},
"outputs": [],
"source": [
"df = pd.DataFrame(naascredits.connect().transactions.get(page_size=page_size))\n",
"df"
"df = pd.DataFrame(naascredits.connect().transactions.get_currents())\n",
"print(len(df))\n",
"print(\"Current balance:\", df.CREDIT.sum())"
]
},
{
Expand Down Expand Up @@ -211,7 +188,7 @@
},
"outputs": [],
"source": [
"df.to_csv(\"billing.csv\")"
"df"
]
}
],
Expand All @@ -231,7 +208,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.9.6"
},
"naas": {
"notebook_id": "5df9412ae66fd7ab475df0c83cd5f8a2f36ca695bb4292dd5433aded3dc2e890",
Expand All @@ -253,4 +230,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}

0 comments on commit 9121176

Please sign in to comment.