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

Support dict type for json argument #22

Open
sfc-gh-pkommini opened this issue Jun 17, 2021 · 1 comment
Open

Support dict type for json argument #22

sfc-gh-pkommini opened this issue Jun 17, 2021 · 1 comment
Assignees

Comments

@sfc-gh-pkommini
Copy link
Collaborator

In this function:

def process_row(
    data: Optional[Text] = None,
    base_url: Text = '',
    url: Text = '',
    json: Optional[Text] = None,
    method: Text = 'get',
    headers: Text = '',
    kwargs: Union[Dict, Text] = '',
    auth: Text = None,
    params: Text = '',
    verbose: bool = False,
    cursor: Text = '',
    results_path: Text = '',
    destination_uri: Text = '',
):

We need to support dict type for json argument.

@sfc-gh-pkommini sfc-gh-pkommini self-assigned this Jun 17, 2021
@sfc-gh-afedorov
Copy link
Collaborator

maybe —

        req_data: Optional[bytes] = (
            dumps(json) if isintance(json, dict)
            else json if json.startswith('{')
            else dumps(parse_header_dict(json))
        ).encode()

in process_http.py#88?

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

No branches or pull requests

2 participants