Skip to content

Commit 2e8032c

Browse files
committed
refactor(sdk/py): improve default parameters
1 parent 1ae419d commit 2e8032c

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

sdk/python/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "oomclient-py"
3-
version = "0.1.0"
3+
version = "0.1.1-rc.0"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

sdk/python/examples/import.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ async def main():
2121
10,Idaho,693,212,true
2222
""".lstrip()
2323
f.write(rows)
24-
await client.import_(group, None, None, path, None)
24+
await client.import_(group, input_file=path)
2525

2626
asyncio.run(main())

sdk/python/src/lib.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,14 @@ impl Client {
161161
///
162162
/// Returns:
163163
/// None
164-
#[pyo3(text_signature = "(group, revision_id, purge_delay)")]
164+
#[pyo3(text_signature = "(group, purge_delay, revision_id=None)")]
165+
#[args(revision_id = "None")]
165166
pub fn sync<'p>(
166167
&mut self,
167168
py: Python<'p>,
168169
group: String,
169-
revision_id: Option<u32>,
170170
purge_delay: u32,
171+
revision_id: Option<u32>,
171172
) -> PyResult<&'p PyAny> {
172173
let mut inner = OomClient::clone(&self.inner);
173174
future_into_py(py, async move {
@@ -184,22 +185,23 @@ impl Client {
184185
/// For batch features, if revision is null, will use the
185186
/// timestamp when it starts serving in online store; otherwise,
186187
/// use the designated revision.
187-
/// description: Description of this import.
188188
/// input_file: The path of data source.
189189
/// delimiter: Delimiter of data source.
190+
/// description: Description of this import.
190191
///
191192
/// Returns:
192193
/// revision_id: The revision ID of this import, it only applies to batch feature.
193194
#[pyo3(name = "import_")]
194-
#[pyo3(text_signature = "(group, revision, description, input_file, delimiter)")]
195+
#[pyo3(text_signature = "(group, input_file, delimiter=None, revision=None, description=None)")]
196+
#[args(delimiter = "None", revision = "None", description = "None")]
195197
pub fn import<'p>(
196198
&mut self,
197199
py: Python<'p>,
198200
group: String,
199-
revision: Option<i64>,
200-
description: Option<String>,
201201
input_file: String,
202202
delimiter: Option<String>,
203+
revision: Option<i64>,
204+
description: Option<String>,
203205
) -> PyResult<&'p PyAny> {
204206
let delimiter = delimiter
205207
.map(|s| {
@@ -281,7 +283,8 @@ impl Client {
281283
///
282284
/// Returns:
283285
/// None
284-
#[pyo3(text_signature = "(features, unix_milli, output_file, limit)")]
286+
#[pyo3(text_signature = "(features, unix_milli, output_file, limit=None)")]
287+
#[args(limit = "None")]
285288
pub fn export<'p>(
286289
&mut self,
287290
py: Python<'p>,

0 commit comments

Comments
 (0)